-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
The X axis gyro data was invalid. This seems to fix it:
void readimuGyro(){
//Extinguish NO ATT
lampit(0,0,0, 16);
compAct();
Wire.beginTransmission(MPU_addr);
Wire.write(0x3B); // starting with register 0x3B (ACCEL_XOUT_H)
Wire.endTransmission(false);
Wire.requestFrom(MPU_addr,14,true); // request a total of 14 registers
Wire.read()<<8|Wire.read();Wire.read()<<8|Wire.read();Wire.read()<<8|Wire.read();Wire.read()<<8|Wire.read();
imuval[4]=Wire.read()<<8|Wire.read(); // 0x43 (GYRO_XOUT_H) & 0x44 (GYRO_XOUT_L)
imuval[5]=Wire.read()<<8|Wire.read(); // 0x45 (GYRO_YOUT_H) & 0x46 (GYRO_YOUT_L)
imuval[6]=Wire.read()<<8|Wire.read(); // 0x47 (GYRO_ZOUT_H) & 0x48 (GYRO_ZOUT_L)
Serial.print("GyX = "); Serial.print(imuval[4]);
Serial.print(" | GyY = "); Serial.print(imuval[5]);
Serial.print(" | GyZ = "); Serial.println(imuval[6]);
setDigits();
}
Metadata
Metadata
Assignees
Labels
No labels