Update Adafruit_BME280.cpp
This fixes a (very minor) bug in the return value of getTemperatureCompensation(). getTemperatureCompensation() was dropping (rounding to integer) the fractional part of the temperature offset due to an integer divide by 100 before casting to a float. For example: if the temperature compensation was 1.49 degC, the value returned was 1.00 This didn't affect the accuracy of the readings (setTemperatureCompensation worked fine), it only gave an incorrect value if you read the value back using getTemperatureCompensation
This commit is contained in:
parent
47a3566553
commit
6d76cd285e
|
|
@ -545,7 +545,7 @@ uint32_t Adafruit_BME280::sensorID(void) { return _sensorID; }
|
||||||
* @returns the current temperature compensation value in degrees Celcius
|
* @returns the current temperature compensation value in degrees Celcius
|
||||||
*/
|
*/
|
||||||
float Adafruit_BME280::getTemperatureCompensation(void) {
|
float Adafruit_BME280::getTemperatureCompensation(void) {
|
||||||
return float(((t_fine_adjust * 5) >> 8) / 100);
|
return float((t_fine_adjust * 5) >> 8) / 100.0;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue