Skip to content

Commit

Permalink
gravity value was correct
Browse files Browse the repository at this point in the history
  • Loading branch information
stefcarpi committed Oct 17, 2024
1 parent a06c1b9 commit fc862d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/MPU6050.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit fc862d1

Please sign in to comment.