Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adafruit_bme680.py: Fix compensation of pressure values #14

Merged
merged 2 commits into from
Dec 2, 2018
Merged

adafruit_bme680.py: Fix compensation of pressure values #14

merged 2 commits into from
Dec 2, 2018

Conversation

robert-hh
Copy link
Contributor

Compared the ot reference code, one expression in the lengthy calculation was split in two lines.
Since a previous interim value was used in the expression twice and replaced by the first
part of the split expression, the overall result was different to the reference code. The resulting
pressure was not that different, 10 hPa at 1000hPa absolute value, but clearly outside of the
spec with 1hPa absolute pressure error.

Compared the ot reference code, one expression in the lengthy calculation was split in two lines. 
Since a previous interim value was used in the expression twice and replaced by the first 
part of the split expression, the overall result was different to the reference code. The resulting
pressure was not that different, 10 hPa at 1000hPa absolute value, but clearly outside of the
spec with 1hPa absolute pressure error.
@caternuson
Copy link
Contributor

caternuson commented Dec 2, 2018

Thanks for the find and the PR to fix. Fairly simple, but tested for goodness. There was one minor indent the linter didn't like, totally cosmetic, @tannewt fixed.

bme680_test

BEFORE

Adafruit CircuitPython 3.1.1 on 2018-11-02; Adafruit ItsyBitsy M4 Express with samd51g19
>>> import board, busio
>>> import adafruit_bme680
>>> i2c = busio.I2C(board.SCL, board.SDA)
>>> bme = adafruit_bme680.Adafruit_BME680_I2C(i2c)
>>> bme.pressure
996.878
>>>

AFTER

Adafruit CircuitPython 3.1.1 on 2018-11-02; Adafruit ItsyBitsy M4 Express with samd51g19
>>> import board, busio
>>> import adafruit_bme680
>>> i2c = busio.I2C(board.SCL, board.SDA)
>>> bme = adafruit_bme680.Adafruit_BME680_I2C(i2c)
>>> bme.pressure
1000.77
>>>

@ladyada @kattni All good. Merge away.

@ladyada ladyada merged commit f1fe707 into adafruit:master Dec 2, 2018
@ladyada
Copy link
Member

ladyada commented Dec 2, 2018

yay thanks!

tannewt pushed a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Jan 15, 2019
Updating https://github.com/adafruit/Adafruit_CircuitPython_ADXL34x to 1.10.1 from 1.10:
  > Merge pull request adafruit/Adafruit_CircuitPython_ADXL34x#7 from siddacious/master

Updating https://github.com/adafruit/Adafruit_CircuitPython_AM2320 to 1.1.3 from 1.1.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_AM2320#7 from sommersoft/readme_fix_travis
  > Merge pull request adafruit/Adafruit_CircuitPython_AM2320#6 from adafruit/pylint-version-fix

Updating https://github.com/adafruit/Adafruit_CircuitPython_APDS to 1.2.3 from 1.1.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_APDS#11 from sommersoft/readme_fix_travis
  > Merge pull request adafruit/Adafruit_CircuitPython_APDS#10 from adafruit/pylint-version-fix

Updating https://github.com/adafruit/Adafruit_CircuitPython_BME680 to 3.0.7 from 3.0.6:
  > Merge pull request adafruit/Adafruit_CircuitPython_BME680#15 from sommersoft/readme_fix_travis
  > Merge pull request adafruit/Adafruit_CircuitPython_BME680#14 from robert-hh/master

Updating https://github.com/adafruit/Adafruit_CircuitPython_BNO055 to 3.0.5 from 3.0.4:
  > Merge pull request adafruit/Adafruit_CircuitPython_BNO055#19 from sommersoft/readme_fix_travis
  > Merge pull request adafruit/Adafruit_CircuitPython_BNO055#18 from adafruit/pylint-version-fix

Updating https://github.com/adafruit/Adafruit_CircuitPython_CCS811 to 1.1.4 from 1.1.3:
  > Merge pull request adafruit/Adafruit_CircuitPython_CCS811#27 from sommersoft/readme_fix_travis
  > Merge pull request adafruit/Adafruit_CircuitPython_CCS811#26 from caternuson/iss25

Updating https://github.com/adafruit/Adafruit_CircuitPython_CharLCD to 3.1.0 from 3.0.3:
  > Merge pull request adafruit/Adafruit_CircuitPython_CharLCD#27 from kattni/add-buttons
  > Merge pull request adafruit/Adafruit_CircuitPython_CharLCD#25 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_DS2413 to 1.1.2 from 1.1.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_DS2413#8 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_FocalTouch to 1.1.2 from 1.1.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_FocalTouch#5 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_FXAS21002C to 1.2.2 from 1.2.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_FXAS21002C#7 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_FXOS8700 to 1.2.2 from 1.2.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_FXOS8700#10 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_HCSR04 to 0.3.4 from 0.3.3:
  > Merge pull request adafruit/Adafruit_CircuitPython_HCSR04#8 from sommersoft/readme_fix_travis
  > Merge pull request adafruit/Adafruit_CircuitPython_HCSR04#7 from adafruit/readme-image-fix

Updating https://github.com/adafruit/Adafruit_CircuitPython_HTU21D to 0.8.1 from 0.8.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_HTU21D#3 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_IRRemote to 3.3.1 from 3.3.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_IRRemote#20 from sommersoft/readme_fix_travis
  > Merge pull request adafruit/Adafruit_CircuitPython_IRRemote#18 from fmorton/master

Updating https://github.com/adafruit/Adafruit_CircuitPython_L3GD20 to 2.0.2 from 2.0.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_L3GD20#11 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_LIDARLite to 1.1.1 from 1.1.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_LIDARLite#3 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_LIS3DH to 4.3.4 from 4.3.3:
  > Merge pull request adafruit/Adafruit_CircuitPython_LIS3DH#49 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_LSM303 to 1.2.3 from 1.2.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_LSM303#10 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_LSM9DS1 to 2.0.2 from 2.0.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_LSM9DS1#14 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_MAX31855 to 3.0.5 from 3.0.4:
  > Merge pull request adafruit/Adafruit_CircuitPython_MAX31855#9 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_MAX31865 to 2.1.2 from 2.1.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_MAX31865#8 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_MCP4725 to 1.1.2 from 1.1.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_MCP4725#6 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_MCP9808 to 3.2.2 from 3.2.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_MCP9808#15 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_MLX90614 to 1.1.1 from 1.1.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_MLX90614#10 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_MMA8451 to 1.2.2 from 1.2.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_MMA8451#4 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_MPL3115A2 to 1.1.2 from 1.1.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_MPL3115A2#4 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_MPRLS to 1.0.3 from 1.0.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_MPRLS#5 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_NeoTre to 1.04 from 1.0.3:
  > Merge pull request adafruit/Adafruit_CircuitPython_NeoTre#4 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_PCA9685 to 3.2.4 from 3.2.3:
  > Merge pull request adafruit/Adafruit_CircuitPython_PCA9685#18 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_PCF8523 to 1.2.2 from 1.2.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_PCF8523#8 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_Pixie to 1.1.2 from 1.1.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_Pixie#6 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_Se to 1.2.7 from 1.2.6:
  > Merge pull request adafruit/Adafruit_CircuitPython_Se#22 from sommersoft/readme_fix_travis
  > Merge pull request adafruit/Adafruit_CircuitPython_Se#21 from adafruit/pylint-version-fix

Updating https://github.com/adafruit/Adafruit_CircuitPython_SGP30 to 2.0.1 from 2.0.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_SGP30#14 from Dmole/patch-1
  > Merge pull request adafruit/Adafruit_CircuitPython_SGP30#13 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_SI4713 to 1.1.2 from 1.1.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_SI4713#6 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_SI5351 to 1.1.2 from 1.1.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_SI5351#3 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_SI7021 to 3.1.2 from 3.1.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_SI7021#10 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_STMPE610 to 1.1.2 from 1.1.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_STMPE610#7 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_TCA9548A to 0.1.2 from 0.1.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_TCA9548A#4 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_TLC5947 to 1.2.1 from 1.2.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_TLC5947#12 from ArthurDent62/negative_indices
  > Merge pull request adafruit/Adafruit_CircuitPython_TLC5947#13 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_TLC59711 to 1.1.2 from 1.1.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_TLC59711#4 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_TSL2561 to 3.1.3 from 3.1.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_TSL2561#18 from caternuson/float_doc
  > Merge pull request adafruit/Adafruit_CircuitPython_TSL2561#21 from sommersoft/readme_fix_travis
  > Merge pull request adafruit/Adafruit_CircuitPython_TSL2561#17 from csylvain/patch-1

Updating https://github.com/adafruit/Adafruit_CircuitPython_VCNL4010 to 0.9.2 from 0.9.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_VCNL4010#5 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_VEML6070 to 2.0.1 from 2.0.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_VEML6070#6 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_VEML6075 to 1.0.2 from 1.0.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_VEML6075#3 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_VL53L0X to 3.1.5 from 3.1.4:
  > Merge pull request adafruit/Adafruit_CircuitPython_VL53L0X#8 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_WS2801 to 0.9.2 from 0.9.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_WS2801#3 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_AVRprog to 1.1.2 from 1.1.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_AVRprog#6 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_BoardTest to 1.0.1 from 1.0.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_BoardTest#4 from ShawnHymel/master
  > Merge pull request adafruit/Adafruit_CircuitPython_BoardTest#3 from ShawnHymel/master

Updating https://github.com/adafruit/Adafruit_CircuitPython_Debouncer to 1.0.2 from 1.0.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_Debouncer#6 from dastels/Dans_suggestions

Updating https://github.com/adafruit/Adafruit_CircuitPython_ImageLoad to 0.8.1 from 0.8.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_ImageLoad#4 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_miniQR to 1.1.1 from 1.1.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_miniQR#4 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_Register to 1.3.3 from 1.3.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_Register#18 from sommersoft/readme_fix_travis
  > Merge pull request adafruit/Adafruit_CircuitPython_Register#17 from adafruit/pylint-version-fix

Updating https://github.com/adafruit/Adafruit_CircuitPython_RTTTL to 2.2.2 from 2.2.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_RTTTL#11 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_ServoKit to 1.0.3 from 1.0.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_ServoKit#5 from kattni/multiple-servo-examo

Updating https://github.com/adafruit/Adafruit_CircuitPython_SimpleIO to 1.1.2 from 1.1.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_SimpleIO#37 from sommersoft/readme_fix_travis

Updating https://github.com/adafruit/Adafruit_CircuitPython_Waveform to 1.2.2 from 1.2.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_Waveform#5 from sommersoft/readme_fix_travis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants