Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Angle Z drifting #40

Open
ImVictorYT opened this issue Mar 8, 2023 · 1 comment
Open

Angle Z drifting #40

ImVictorYT opened this issue Mar 8, 2023 · 1 comment

Comments

@ImVictorYT
Copy link

sometimes the angle z keeps increasing with out movemnt

@cemyasam2
Copy link

cemyasam2 commented Sep 8, 2023

sometimes the angle z keeps increasing with out movemnt
Find the following line in the MPU6050_light.cpp file

  accX = ((float)rawData[0]) / ACC_LSB_2_G;
  accY = ((float)rawData[1]) / ACC_LSB_2_G;
  accZ = ((float)rawData[2]) / ACC_LSB_2_G;
  temp = (rawData[3] + TEMP_LSB_OFFSET) / TEMP_LSB_2_DEGREE;
  gyroX = ((float)rawData[4]) / GYRO_LSB_2_DEGSEC - gyroXoffset;
  gyroY = ((float)rawData[5]) / GYRO_LSB_2_DEGSEC - gyroYoffset;
  gyroZ = ((float)rawData[6]) / GYRO_LSB_2_DEGSEC - gyroZoffset;

Please add the line below

if(gyroZ>-0.4 && gyroZ<0.4) {gyroZ=0;}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants