Isabella Gomez Torres
/
IMU6050
additional edits to James’ code
Diff: MPU6050.cpp
- Revision:
- 6:502448484f91
- Parent:
- 5:5873df1e58be
- Child:
- 7:56e591a74939
diff -r 5873df1e58be -r 502448484f91 MPU6050.cpp --- a/MPU6050.cpp Thu Feb 12 20:56:04 2015 +0000 +++ b/MPU6050.cpp Thu Feb 12 21:01:38 2015 +0000 @@ -150,7 +150,7 @@ //function for getting angles from accelerometer void MPU6050::getAcceleroAngle( float *data ) { - int temp[3]; + float temp[3]; this->getAccelero(temp); data[X_AXIS] = -1*atan (-1*temp[Y_AXIS]/sqrt(pow(temp[X_AXIS], 2) + pow(temp[Z_AXIS], 2))) * RADIANS_TO_DEGREES; //calculate angle x(pitch/roll?) from accellerometer reading @@ -170,8 +170,8 @@ for (int i = 0; i < sampleSize; i++) { - mpu.getGyro(gyro); //take real life measurements - mpu.getAcceleroAngle (accAngle); + this->getGyro(gyro); //take real life measurements + this->getAcceleroAngle (accAngle); for (int j = 0; j < 3; j++) {