This repository contains a short example script that tests out the ISM330DLC iNEMO inertial module: 3D accelerometer and 3D gyroscope with digital output using my own Raspberry Pi I2C library. This test includes setting up the device and reading magnetic field data.
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"
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
First, clone this repository.
$ git clone https://github.com/besp9510/pi_ism330dlc_example.git
Alternatively, download the repository from Git.
Compile test_lis3mdl.c into an executable.
$ make
test_lis3mdl.c is a test script to check and see the I2C library working on your Pi with a ISM330DLC device. The outline of the test is:
- Configure I2C library
- Scan for the device
- Verify device I.D.
- Configure device
- Set output data rate and sensitivity
- Select operating mode
- Read accelerometer and gyroscope data in a loop
- Write data to a CSV file
Follow the "fork-and-pull" Git workflow.
- Fork the repo on GitHub
- Clone the project to your own machine
- Commit changes to your own branch
- Push your work back up to your fork
- 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.
Benjamin Spencer
This project is licensed under the MIT License - see the LICENSE.md file for details