Thanks Erik Olieman for his beta library, that saved me a huge amount of time when getting Raw data from MPU6050 module! I was able to update this library by adding additional functions, which would allow a fast angle calculation by using complementary filter. I will probably be updating this library more soon to add additional functionality or make some changes that would look sensible.
Dependents: QuadcopterProgram 3DTracking ControlYokutan2017 Gyro ... more
Fork of MPU6050 by
Diff: MPU6050.cpp
- Revision:
- 1:a3366f09e95c
- Parent:
- 0:6757f7363a9f
- Child:
- 3:187152513f8d
--- a/MPU6050.cpp Wed Jul 11 12:26:47 2012 +0000 +++ b/MPU6050.cpp Mon Sep 10 21:22:39 2012 +0000 @@ -196,22 +196,22 @@ void MPU6050::getGyro( float *data ) { int temp[3]; this->getGyroRaw(temp); - if (currentAcceleroRange == MPU6050_GYRO_RANGE_250) { + if (currentGyroRange == MPU6050_GYRO_RANGE_250) { data[0]=(float)temp[0] / 7505.7; data[1]=(float)temp[1] / 7505.7; data[2]=(float)temp[2] / 7505.7; } - if (currentAcceleroRange == MPU6050_GYRO_RANGE_500){ + if (currentGyroRange == MPU6050_GYRO_RANGE_500){ data[0]=(float)temp[0] / 3752.9; data[1]=(float)temp[1] / 3752.9; data[2]=(float)temp[2] / 3752.9; } - if (currentAcceleroRange == MPU6050_GYRO_RANGE_1000){ + if (currentGyroRange == MPU6050_GYRO_RANGE_1000){ data[0]=(float)temp[0] / 1879.3;; data[1]=(float)temp[1] / 1879.3; data[2]=(float)temp[2] / 1879.3; } - if (currentAcceleroRange == MPU6050_GYRO_RANGE_2000){ + if (currentGyroRange == MPU6050_GYRO_RANGE_2000){ data[0]=(float)temp[0] / 939.7; data[1]=(float)temp[1] / 939.7; data[2]=(float)temp[2] / 939.7;