Open NadimDeeb opened 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?
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);
}
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?