I'm new to the MPU6050 but getting some good results using 8051 micro interfaced to GY-521 breakout board to MPU6050.
One puzzling thing is that while the Invensense register map for the MPU6050 states:
REGISTERS 59 TO 64 – ACCELEROMETER MEASUREMENTS
REGISTERS 67 TO 72 – GYROSCOPE MEASUREMENTS
After a 200 mSec delay I measure the offsets, save them and subtract the offsets from the X,Y, and Z values of the acceleration and gyro angles. The results show values near zero after subtracting the offsets. So far, so good.
But...I get the Gyro and Acceleration reversed. When I rotate the GY-521 90 degrees and then keep the board stable at the 90 degree position, the Acceleration values stay at a high value but the Gyro angle goes back to zero. When I rotate the board back to the resting position both the acceleration and gyro values got back to near zero. The gyro values only change when the board is actually being moved and go back to zero when the board is stationary, irregardless of the position/angle of the board.
Here is the code:
ReadBytesIIC(59,14); //Read 14 register bytes starting at MPU6050 register 59.
//Array=register 59, Array=register 60, etc.
printf("\nAX,Y,Z, GX,Y,Z=%5d %5d %5d %5d %5d %5d",AccX,AccY,AccZ,GyroX,GyroY,GyroZ);
Can anyone explain to me why this might be happening?
Thank you in advance.