adafruit / Adafruit_CircuitPython_TCA9548A

CircuitPython driver for the TCA9548A I2C Multiplexer.
MIT License
26 stars 14 forks source link

Add scan() #27

Closed caternuson closed 3 years ago

caternuson commented 3 years ago

For #26. Nice and simple, just defer to underlying I2C.

Example with a BME680 attached to TCA channel 4:

Adafruit CircuitPython 6.1.0 on 2021-01-21; Adafruit QT Py M0 with samd21e18
>>> import board
>>> import adafruit_tca9548a
>>> tca = adafruit_tca9548a.TCA9548A(board.I2C())
>>> tca[4].try_lock()
True
>>> tca[4].scan()
[112, 118]
>>> 

112 is the TCA, 118 is the BME.