Test program for MPU9250 sensor

Dependencies:   MPU9250

README.md

Committer:
andrewbates11
Date:
2017-09-27
Revision:
1:e542337d8586
Parent:
0:6ffb1296d690

File content as of revision 1:e542337d8586:

PDIOT Example mbed program
--------------------------

Program to test I2C communication and sensor values from the MPU9250 board.
Outputs to serial port.
Acceleration values are shown in G and gyro values in degress per second.

To run:
Copy the .hex file to the J-link drive and keep the USB cable connected. 
Open a serial console to view the output.

Expected output:
I AM 0x71

I SHOULD BE 0x71

Self test result 0: 3.746911
Self test result 1: -1.245075
Self test result 2: -0.165160
Self test result 3: 0.021077
Self test result 4: -1.124052
Self test result 5: 0.295831
accel: (-0.674744, 0.749390, -0.046814)
gyro: (-0.556946, 0.877380, 0.915527)
cel: (-0.672729, 0.751099, -0.047363)
gyro: (-0.427246, 0.579834, 0.411987)
accel: (-0.671387, 0.751160, -0.045959)
gyro: (-0.778198, 0.442505, 0.709534)
accel: (-0.675110, 0.748657, -0.046570)
gyro: (-0.045776, 1.831055, 0.007629)

Acceleration should show 1.0 on the axis that is facing straight down.
Gyro values should be close to zero unless you rotate the sensor.

Known bugs:
1. If you enable the init function for the MPU9250, the acceleration and gyro
   values are constant. It seems to work OK without this.
   
2. Running the code by flashing and allowing the NRF52 to run straight away
   seems to work. Switching the NRF board on so that it runs the already
   flashed code makes it lock up.