MPRLS board requires a software fix to run on pi pico loaded with latest circuitpython code. The I2C portion of code appears to be broken. The following error pops up:
AttributeError: 'module' object has no attribute 'I2C'.
mprls.py code has no output when run. Just >>> comes back.
What is the fix?
MPRLS board code does not work.
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- danhalbert
- Posts: 4688
- Joined: Tue Aug 08, 2017 12:37 pm
Re: MPRLS board code does not work.
Without looking at the code, I can't be sure, but the Pi Pico does not have a default I2C device `board.I2C()` defined, because there are no pins labeled on the board to be the default I2C device. (There are various standards for the "default" I2C pins on the Pi Pico, but there is more than one choice!)
So use `busio.I2C(board.something, board.somethingelse)` instead. See https://learn.adafruit.com/getting-star ... es-3082902 for more information.
So use `busio.I2C(board.something, board.somethingelse)` instead. See https://learn.adafruit.com/getting-star ... es-3082902 for more information.
- gprz
- Posts: 2
- Joined: Sun Aug 28, 2022 7:01 pm
Re: MPRLS board code does not work.
Thank you for helping. I added the following code and the Pico now reads and displays the Adafruit MPRLS board pressure.
i2c = busio.I2C(scl=board.GP1, sda=board.GP0)
Best Regards
George
i2c = busio.I2C(scl=board.GP1, sda=board.GP0)
Best Regards
George
Please be positive and constructive with your questions and comments.