Closed el-han closed 3 years ago
Current code seems to match section 4.2.3 of datasheet: https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bme280-ds002.pdf Can you clarify where you are seeing the implementation you have coded?
I used the driver which is provided by Bosch as a reference: https://github.com/BoschSensortec/BME280_driver
Aw bummer! Seems like I have overlooked the return line in readPressure()
. Sorry for that! Yes, the pressure is off by factor 2.56. I will fix that.
@elli89 Sorry for not getting back to this in a while. See suggested code change above. Also - did you test this, similar to my test above, to make sure the readings come out generally as expected?
I'm going to go ahead and merge this. The one code suggestion was fairly cosmetic. Hopefully these updates help with #78.
Just tested one more time with latest updates and looks good.
This PR is a proposed fix for #78
It uses the reference implementation of the compensation algorithm from the datasheet. This implementation uses division operations instead of bit shifts.