FTDI to TCA9548a using python on Windows computer

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
charroaleman
 
Posts: 1
Joined: Thu Jul 29, 2021 9:18 pm

FTDI to TCA9548a using python on Windows computer

Post by charroaleman »

Hello, I'm new at this. I have a project where we are reading parameters from this i2c capable IC using an FTDI dongle in a Python environment. I can talk to the device no problems. We will be testing hundreds of this IC at a time and I want to use the TCA9548a but I'm having issues communicating with the TCA. There seems to be little sample code for python and the TCA. When trying to do a scan for the addresses using this code, the functions "try_lock(), .unlock() are not recognize. this is what I get :

if tca[channel].try_lock():
File "C:\Users\JFernandez\Anaconda3\lib\site-packages\adafruit_tca9548a.py", line 51, in try_lock
while not self.tca.i2c.try_lock():

can someone please help


'' online code''
tca = adafruit_tca9548a.TCA9548A(i2c, 0x70)

for channel in range(8):
if tca[channel].try_lock():
print("Channel {}:".format(channel), end="")
addresses = tca[channel].scan()
print([hex(address) for address in addresses if address != 0x70])
tca[channel].unlock()

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

Return to “Adafruit CircuitPython”