I noticed that my itsybitsy rp2040 fails to probe the specified address (0x2A) when instantiating an I2CDevice object. However, if I manually probe for the address using a busio.I2C.scan() first, then the I2CDevice object can correctly probe the device_address upon instantiation. I tried CirPy v8.0.4 and v7.3.3, and both exhibit the same behavior.
Code: Select all
import board
from adafruit_bus_device.i2c_device import I2CDevice
i2c = board.I2C()
while i2c.try_lock():
pass
addrs = i2c.scan() # needed on itsy rp2
i2c.unlock()
assert 0x2A in addrs, "could not find device at address 0x2A"
device = I2CDevice(i2c, 0x2A)
Code: Select all
import board
from adafruit_bus_device.i2c_device import I2CDevice
i2c = board.I2C()
device = I2CDevice(i2c, 0x2A) # probes address correctly on itsy m4
Code: Select all
ValueError: No I2C device at address: 0x2a