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: MPU6050.cpp
- Revision:
- 8:b1570b99df9e
- Parent:
- 7:56e591a74939
- Child:
- 9:898effccce30
--- a/MPU6050.cpp Fri Feb 13 01:04:17 2015 +0000 +++ b/MPU6050.cpp Fri Feb 13 01:16:00 2015 +0000 @@ -202,6 +202,21 @@ angle[Z_AXIS] = angle[Z_AXIS] + GYRO_SCALE*gyro[Z_AXIS]*(*currTime-*prevTime); //this is Yaw hopefully :D //Y = atan2(rawY,rawZ) * 180 / PI; //This spits out values between -180 to 180 (360 degrees) } + +void MPU6050::enableInt( void ) +{ + char temp; + temp = this->read(MPU6050_RA_INT_ENABLE); + temp |= 0x01; + this->write(MPU6050_RA_INT_ENABLE, temp); +} +void MPU6050::disableInt ( void ) +{ + char temp; + temp = this->read(MPU6050_RA_INT_ENABLE); + temp &= 0xFE; + this->write(MPU6050_RA_INT_ENABLE, temp); +} //-------------------------------------------------- //------------------Gyroscope----------------------- //--------------------------------------------------