sparkfun / SparkFun_BME280_Arduino_Library

An Arduino library to control the BME280 humidity and pressure sensor.
https://www.sparkfun.com/products/14348
Other
119 stars 113 forks source link

firstly read temperature for avoiding wrong calculation #51

Open emre-h opened 3 years ago

emre-h commented 3 years ago

I have used the library and it was giving wrong altitude values because of not calling the readTempC() before calling readFloatAltitudeMeters(). Then I have called it and it has been fixed.

nseidle commented 3 years ago

Thanks for the PR!

Does this method come from the datasheet? Why do you readFloatPressure twice?

Hmm, it looks like t_fine gets set in readTempC and is used in readFloatPressure.

emre-h commented 3 years ago

It has fixed the wrong calculation. You can try it with or without my two-line containing commit. (it will probably give the wrong meter calculation without this commit)