tockn / MPU6050_tockn

Arduino library for easy communication with MPU6050
226 stars 89 forks source link

Accelerometer getting stuckk at value 0. #51

Open NadimDeeb opened 1 year ago

NadimDeeb commented 1 year ago

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?