janw-cz / JWA_BME280

Arduino library for BME280 sensor based on reference driver
15 stars 9 forks source link

Incorrect pressure value #4

Closed soosp closed 6 years ago

soosp commented 6 years ago

The pressure value is not in the correct range after upgrading to 3.3.4 driver.

Code:

p = sensor.getPressure() / 100.0F;
Serial.print("Debug pressuere: ");
Serial.print(p);
Serial.println(" hPa");

Result: Debug pressuere: 99035.32 hPa

It should be: Debug pressuere: 990.35 hPa

janw-cz commented 6 years ago

It really was incorrect. I forgot to switch off 64-bit calculation of pressure, this was a side effect. I have now committed switch to 32-bit calculation which fixes this issue.

soosp commented 6 years ago

Thank you, I tested it on my project and it works well.