Set max interval for sleep + use first gyro temp

This commit is contained in:
Magnus
2021-04-11 11:29:15 +02:00
parent c1c325a2bc
commit 1269bf6f0e
7 changed files with 23 additions and 10 deletions

View File

@ -211,10 +211,16 @@ bool GyroSensor::read() {
} else {
validValue = true;
angle = calculateAngle( raw );
sensorTemp = ((float) raw.temp) / 340 + 36.53;
//Log.notice(F("GYRO: Calculated angle %F" CR), angle );
}
sensorTemp = ((float) raw.temp) / 340 + 36.53;
// The first read value is close to the DS18 value according to my tests, if more reads are
// done then the gyro temp will increase to much
if( initialSensorTemp == INVALID_TEMPERATURE )
initialSensorTemp = sensorTemp;
return validValue;
}