Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: MyMPU6050.h
- Revision:
- 11:feab67f916fe
- Parent:
- 10:6167cc7e7d60
- Child:
- 12:775e1464e042
--- a/MyMPU6050.h Sat Dec 05 09:04:10 2015 +0000 +++ b/MyMPU6050.h Tue Dec 08 22:52:15 2015 +0000 @@ -56,7 +56,7 @@ if ((mpuIntStatus & 0x10) || fifoCount == 1024) { // reset so we can continue cleanly mpu.resetFIFO(); - _pc->printf("FIFO overflow!\n"); +// _pc->printf("FIFO overflow!\n"); // otherwise, check for DMP data ready interrupt (this should happen frequently) } else if (mpuIntStatus & 0x02) { @@ -81,7 +81,7 @@ else newTheta = M_PI-ypr[2]; mpu.dmpGetGyro(gyroData, fifoBuffer); - float newDTheta = gyroData[2]/180.0*M_PI; + float newDTheta = -gyroData[2]/180.0*M_PI; if (!thetaInitFlag && abs(newTheta-theta)>0.3) { // _pc->printf("IMU interrupt clash\n"); @@ -127,6 +127,7 @@ } void enableInterrupt(){ + mpu.resetFIFO(); checkpin.rise(this, &MyMPU6050::dmpDataReady); }