MPU6050 library using i2c interface on LPC1768 - Complementary filter is added. Now program can calculate pitch and roll angles.
Fork of MPU6050 by
Diff: MPU6050.cpp
- Revision:
- 5:5bff0edcdff8
- Parent:
- 4:20f1f660e5c3
- Child:
- 6:5b90f2b5e6d9
--- a/MPU6050.cpp Wed Aug 05 12:17:44 2015 +0000 +++ b/MPU6050.cpp Wed Aug 05 12:45:47 2015 +0000 @@ -161,7 +161,9 @@ // Sample rate: 200Hz for gyro and acc // Interrupts are disabled void MPU6050::init() -{ +{ + i2c.frequency(400000); // fast i2c: 400 kHz + /* Wake up the device */ writeByte(MPU6050_ADDRESS, PWR_MGMT_1, 0x00); // wake up the device by clearing the sleep bit (bit6) wait_ms(100); // wait 100 ms to stabilize