Skip to content

Bug : Channel Switch Missing in TCA9548A_Channel.scan #31

Closed
@codenio

Description

@codenio

Action: To perform i2c scan on a particular channel in TCA9548A

...
# Initialize I2C bus.
i2c = busio.I2C(I2C1_SCL_PIN,I2C1_SDA_PIN)
# default TCA address=0x70
tca = adafruit_tca9548a.TCA9548A(i2c)

print([hex(i) for i in i2c.scan()])
print([hex(i) for i in tca[0].scan()])
...

Expected result: Perform i2c scan on selected channel

$ python i2c-mux.py 
['0x70']
['0x60', '0x70'] #MCP4725 DAC module is connected to channel 0 of TCA9548A
Press Entre to exit..

Actual Result: It Performs i2c scan on actual i2c bus where TCA9548A is connected

$ python i2c-mux.py 
['0x70']
['0x70']
Press Entre to exit..

Correction : TCA9548A_Channel.scan needs to be modified

def scan(self):
"""Perform an I2C Device Scan"""
return self.tca.i2c.scan()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions