MPRLS board code does not work.

CircuitPython on hardware including Adafruit's boards, and CircuitPython libraries using Blinka on host computers.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
gprz
 
Posts: 2
Joined: Sun Aug 28, 2022 7:01 pm

MPRLS board code does not work.

Post by gprz »

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?

User avatar
danhalbert
 
Posts: 4649
Joined: Tue Aug 08, 2017 12:37 pm

Re: MPRLS board code does not work.

Post by danhalbert »

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.

User avatar
gprz
 
Posts: 2
Joined: Sun Aug 28, 2022 7:01 pm

Re: MPRLS board code does not work.

Post by gprz »

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

Locked
Please be positive and constructive with your questions and comments.

Return to “Adafruit CircuitPython”