I need help how to access the STEAMMA QT port on the Interstate 75 in Micro Python (pimoroni-pico-v1.18.4-micropython.uf2). I’ve connected an Adafruit BME680 to display temperature, humidity and pressure. I have already tried to scan the Port with the following code but only empty Brackets are returned.
from machine import Pin, I2C
i2c = I2C(id=0, sda=Pin(20),scl=Pin(21))
print(i2c.scan())
On a Feather RP2040 with Micro Python the BME680 is working.
Do you have any ideas how to access the I2C properly?
Try this code. It’s worked for me on my Pico. The Stemma is wired right to those pins so it should “just work”. I’m using the Qwicc on my Pico Lipo and didn’t have to do anything fancy, other than plugging in a cable and sensor. BME688 and others here.
import machine
sda=machine.Pin(20) # Explorer 20 Breakout 4
scl=machine.Pin(21) # Explorer 21 Breakout 5
i2c=machine.I2C(0,sda=sda, scl=scl, freq=400000)
print('Scan i2c bus...')
devices = i2c.scan()
if len(devices) == 0:
print("No i2c device !")
else:
print('i2c devices found:',len(devices))
for device in devices:
print("Decimal address: ",device," | Hex address: ",hex(device))
Ok, we know the BME680 works, and the cable must be OK.
And I checked the schematic and the i75 does use GPIO 20 and 21 for i2c.
And running that code on my Pico Lipo gets me a list of what I have connected. It uses pins 4 & 5 though.
Must be a bad jack on the i75, or a bad connection to it?
Yeah, I’m inclined to agree - I don’t have an I75 to hand to test, but @alphanumeric 's code is detecting breakouts fine for me on a Plasma 2040 which should have the same I2C setup.
Support should be able to sort you out with a replacement, make sure to send them a link to this thread if you haven’t already :)
Saturday the replacement part arrived and as suspected my I2C problems were caused by a fault on the Interstate 75.
Thank you for the fast and uncomplicated exchange.