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:
danbaker-projects 2020-10-13 13:47:44 -04:00 committed by GitHub
parent 47a3566553
commit 6d76cd285e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}; };
/*! /*!