sparkfun / Qwiic_BME280_Py

Python module for the qwiic bme280 sensor
MIT License
11 stars 3 forks source link

Pressure and Humidity Measurements Return Wrong Value if Called Before Temperature Measurement #5

Closed electronsandstuff closed 10 months ago

electronsandstuff commented 2 years ago

Thanks for the library!

I did notice one point of confusion while using it: When measuring pressure and humidity from the sensor, the attribute t_fine is used. However, it doesn't get read from the chip unless you call get_temperature_celsius. For my application this gave large error in the pressure until I realized this was happening and called the temperature measurement first.

Maybe this could be more clearly explained in the documentation, or the function could be modified to get t_fine if it has not been read recently, or a warning could be printed if the user reads the pressure without t_fine being set? I am just trying to think of how to save other users the time I spent debugging my pressure measurement.

One other note: I think the docstring for read_pressure is out of date. It says the function outputs an integer representation of the pressure which needs to be divided to convert it which appears to no longer be the case.