This program provides basic functionality of the MPU-9250 with a Raspberry Pi over an I2C interface. The program uses the pigpio library for the I2C read and write functionality.
This program was tested on a Raspberry Pi Zero W running Raspbian GNU/Linux 10 (buster).
You would first need to check if you have pigpio installed. To do so, run the following line of code in the terminal.
pigpiod -v
If the command is not recognized you can download and install pigpio. Once pigpio is installed, you may download and build this program. To do so, run the following lines in the terminal:
git clone https://github.com/Alexgichamba/mpu9250-with-raspberrypi.git
cd mpu9250-with-raspberrypi/
make
Then you may run the program:
sudo ./bin/mpu9250
- Read and output inertial measurment unit data
- Read and output temperature data
- Calculate and log maximums and minimums to a file
- Read and output magnetometer data
- Plot the data on graphs