Skip to content

Fix temperature reads and RP2040 reset quirk #22

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

Merged
merged 2 commits into from
Jul 27, 2022

Conversation

caternuson
Copy link
Contributor

Hopefully fixes #19. The two main things were:

  • temperature getter was missing a call to initiate one shot measurement (which explains why the wait loop went forever)
  • needed to add a try/except hack to deal with RP2040 not liking reset behavior and I2C bus getting unhappy

BONUS - also changes pressure to be hectopascals per the Design Guide.

Repeating same test from issue thread now works:

Adafruit CircuitPython 7.3.2 on 2022-07-20; Raspberry Pi Pico with rp2040
>>> import board
>>> import busio
>>> import adafruit_mpl3115a2
>>> scldata = board.GP7
>>> sdadata = board.GP6
>>> i2c = busio.I2C(scldata, sdadata)
>>> sensor = adafruit_mpl3115a2.MPL3115A2(i2c)
>>> sensor.pressure
1006.9
>>> sensor.temperature
27.125
>>> 

@caternuson caternuson requested a review from a team July 27, 2022 23:20
@ladyada
Copy link
Member

ladyada commented Jul 27, 2022

@evaherrada this will have to be a major version bump since the value has changed. guide will also need updating

@caternuson caternuson merged commit 5433c99 into adafruit:main Jul 27, 2022
@caternuson
Copy link
Contributor Author

@evaherrada I went ahead and made a release:
https://github.com/adafruit/Adafruit_CircuitPython_MPL3115A2/releases/tag/2.0.0

adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Jul 28, 2022
Updating https://github.com/adafruit/Adafruit_CircuitPython_CharLCD to 3.4.0 from 3.3.15:
  > Merge pull request adafruit/Adafruit_CircuitPython_CharLCD#72 from Neradoc/compatibility-rainbowio
  > Changed .env to .venv in README.rst
  > Removed duplicate-code from library pylint disable

Updating https://github.com/adafruit/Adafruit_CircuitPython_EPD to 2.10.5 from 2.10.4:
  > Create requirements.txt
  > Changed .env to .venv in README.rst

Updating https://github.com/adafruit/Adafruit_CircuitPython_LIS3MDL to 1.1.17 from 1.1.16:
  > Merge pull request adafruit/Adafruit_CircuitPython_LIS3MDL#22 from adafruit/lsm6dstrc
  > Changed .env to .venv in README.rst

Updating https://github.com/adafruit/Adafruit_CircuitPython_MPL3115A2 to 2.0.0 from 1.2.12:
  > Merge pull request adafruit/Adafruit_CircuitPython_MPL3115A2#22 from caternuson/iss19
  > Changed .env to .venv in README.rst

Updating https://github.com/adafruit/Adafruit_CircuitPython_PN532 to 2.3.10 from 2.3.9:
  > Merge pull request adafruit/Adafruit_CircuitPython_PN532#57 from tekktrik/doc/fix-product-link
  > Changed .env to .venv in README.rst
  > Removed duplicate-code from library pylint disable

Updating https://github.com/adafruit/Adafruit_CircuitPython_SI1145 to 1.0.1 from 1.0.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_SI1145#6 from tekktrik/doc/add-product-link

Updating https://github.com/adafruit/Adafruit_CircuitPython_asyncio to 0.5.12 from 0.5.11:
  > Create requirements.txt

Updating https://github.com/adafruit/Adafruit_CircuitPython_AzureIoT to 2.5.8 from 2.5.7:
  > Updated sphinx version
  > Changed .env to .venv in README.rst

Updating https://github.com/adafruit/Adafruit_CircuitPython_BLE to 8.3.4 from 8.3.3:
  > Merge pull request adafruit/Adafruit_CircuitPython_BLE#168 from tekktrik/doc/add-type-annotations
  > Changed .env to .venv in README.rst
  > Removed duplicate-code from library pylint disable

Updating https://github.com/adafruit/Adafruit_CircuitPython_Hue to 1.2.0 from 1.1.10:
  > Merge pull request adafruit/Adafruit_CircuitPython_Hue#21 from tekktrik/dev/specific-error
  > Changed .env to .venv in README.rst
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.

Getting ETIMEDOUT on Pi Pico (others?)
2 participants