pimoroni / bme280-python

Python library for the BME280 temperature, pressure and humidity sensor
https://shop.pimoroni.com/products/bme280-breakout
MIT License
65 stars 25 forks source link

Match compensate_humidity algo to the one published by BoschSensortec #11

Closed iohe closed 4 years ago

iohe commented 4 years ago

Hi Team, there is one element missing from compensate_humidity, even if in my bme280 sensor from Enviro+ this value is always 1.0: var5 = (1.0 + (((double)calib_data->dig_h3) / 67108864.0) * var1);

This PR adds above element and aligns algo with implementation from 
https://github.com/BoschSensortec/BME280_driver/blob/master/bme280.c#L1238

Feel free to add or not this PR :)

Thank you!

Gadgetoid commented 4 years ago

Thank you for taking the time to PR this. I have totally failed to understand the difference, but I have added a humidity test into our test suite and your change passes- so I'll give it a shot!