Skip to content

Accelerometer getting stuckk at value 0. #51

Description

@NadimDeeb

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions