Program takes accelerometer and gyroscope data from the MPU6050 registers and calibrates them for better results. Then uses this data is to obtain pitch and roll angles and writes these angles to the terminal which mbed is connected to.
Dependencies: MPU6050 ledControl2 mbed
Diff: main.cpp
- Revision:
- 7:3e1e78b34e1a
- Parent:
- 6:12ff524abb6a
diff -r 12ff524abb6a -r 3e1e78b34e1a main.cpp --- a/main.cpp Wed Aug 05 12:23:06 2015 +0000 +++ b/main.cpp Wed Aug 05 13:15:31 2015 +0000 @@ -77,7 +77,6 @@ int main() { pc.baud(9600); // baud rate: 9600 - i2c.frequency(400000); // fast i2c: 400 kHz mpu6050.whoAmI(); // Communication test: WHO_AM_I register reading wait(1); mpu6050.calibrate(accelBias,gyroBias); // Calibrate MPU6050 and load biases into bias registers