Took Kris Winer's code and added some functions for the MPU6050
Fork of MPU6050 by
Diff: MPU6050.h
- Revision:
- 3:6624faa750c7
- Parent:
- 2:19e22a4eaa18
--- a/MPU6050.h Wed Feb 11 20:15:11 2015 +0000 +++ b/MPU6050.h Sat Mar 14 15:44:48 2015 +0000 @@ -735,8 +735,9 @@ // ======== UNDOCUMENTED/DMP REGISTERS/METHODS ======== // Get the data and convert it - void getAndConvertData(float *ax, float *ay, float *az, float *yaw, float *pitch, float *roll, float *accel_bias, float *gyro_bias); - void MadgwickQuaternionUpdate(float *ax, float *ay, float *az, float gx, float gy, float gz, float *q); + void getAndConvertData(float *ax, float *ay, float *az, float *yaw, float *pitch, float *roll, + float *accel_bias, float *gyro_bias, float *gx, float *gy, float *gz); + void MadgwickQuaternionUpdate(float *ax, float *ay, float *az, float gx, float gy, float gz); // XG_OFFS_TC register uint8_t getOTPBankValid(); @@ -1042,7 +1043,7 @@ uint8_t devAddr; uint8_t buffer[14]; - float last_update, first_update, cur_time; + int last_update, first_update, cur_time; // Gyroscope meas. error in rad/s (start at 60 deg/s), then reduce // after ~10 to 3 @@ -1053,6 +1054,8 @@ // Compute zeta, the other free parameter in the Madgwick scheme // usually set to a small or zero value float zeta; + + float q[4]; }; #endif /* _MPU6050_H_ */ \ No newline at end of file