Skip to content

Raspberry Pi LIS3MDL example using a home-made I2C library

License

Notifications You must be signed in to change notification settings

besp9510/pi_lis3mdl_example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Raspberry Pi LIS3MDL Example

This repository contains a short example script that tests out the LIS3MDL digital output magnetic sensor using my own Raspberry Pi I2C library. This test includes setting up the device and reading magnetic field data.

gpio

This example requires the following dependencies (projects authored by me):

  • pi_lw_gpio.c
    • "Lightweight GPIO Interface Library for the Raspberry Pi"
  • pi_microsleep_hard.c
    • "Hard Microsleep Library Via System Timer for the Raspberry Pi"
  • pi_i2c.c
    • "Inter-Integrated Circuit (I2C) Library for the Raspberry Pi"

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Installing

Obtain the Project

First, clone this repository.

$ git clone https://github.com/besp9510/pi_lis3mdl_example.git

Alternatively, download the repository from Git.

Make

Compile test_lis3mdl.c into an executable.

$ make

Running the Test

test_lis3mdl.c is a test script to check and see the I2C library working on your Pi with a LIS3MDL device. The outline of the test is:

  1. Configure I2C library
  2. Scan for the device
  3. Verify device I.D.
  4. Configure device
    • Set performance mode and sensitivity
  5. Select operating mode
  6. Get measurement status
  7. Read magnetic field data in a loop

Contributing

Follow the "fork-and-pull" Git workflow.

  1. Fork the repo on GitHub
  2. Clone the project to your own machine
  3. Commit changes to your own branch
  4. Push your work back up to your fork
  5. Submit a Pull request so that your changes can be reviewed

Be sure to merge the latest from "upstream" before making a pull request!

Feel free to email at the email address under my account name if you have any questions.

Authors

Benjamin Spencer

License

This project is licensed under the MIT License - see the LICENSE.md file for details

About

Raspberry Pi LIS3MDL example using a home-made I2C library

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published