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

Accelerometer getting stuckk at value 0. #51

Open
NadimDeeb opened this issue Apr 25, 2023 · 0 comments
Open

Accelerometer getting stuckk at value 0. #51

NadimDeeb opened this issue Apr 25, 2023 · 0 comments

Comments

@NadimDeeb
Copy link

mpu6050.update();

if(millis() - timer > 100){
avg_acc = sqrt(pow(mpu6050.getAccX(),2) + pow(mpu6050.getAccY(),2) +pow(mpu6050.getAccZ(), 2));

// Serial.print("avacc");
Serial.println(avg_acc);

timer = millis();

}

This code gives me the acceleration magnitude, and it works fine. But the issue s that sometimes when I raise the sensor above a certain level the magnitude goes down to 0 and gets stuck there. Can anyone help?

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

1 participant