From fc862d14e8deed55ac54f11abb1f31993a895226 Mon Sep 17 00:00:00 2001 From: sfncrp Date: Thu, 17 Oct 2024 15:10:15 +0200 Subject: [PATCH] gravity value was correct --- src/MPU6050.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MPU6050.cpp b/src/MPU6050.cpp index 8f1c94e..81a3332 100644 --- a/src/MPU6050.cpp +++ b/src/MPU6050.cpp @@ -3415,7 +3415,7 @@ void MPU6050_Base::PID(uint8_t ReadAddress, float kP,float kI, uint8_t Loops){ int16_t eSample; uint32_t eSum; uint16_t gravity = 8192; // prevent uninitialized compiler warning - if (ReadAddress == 0x3B) gravity = 32768 >> getFullScaleAccelRange(); + if (ReadAddress == 0x3B) gravity = 16384 >> getFullScaleAccelRange(); Serial.write('>'); for (int i = 0; i < 3; i++) { I2Cdev::readWords(devAddr, SaveAddress + (i * shift), 1, (uint16_t *)&Data, I2Cdev::readTimeout, wireObj); // reads 1 or more 16 bit integers (Word)