首页 > 解决方案 > TCA9548A I2C 多路复用器与 ADS1100 使用 python 和树莓派

问题描述

我想使用 Adafruit 的 tca9548a 多路复用器: https ://github.com/adafruit/Adafruit_CircuitPython_TCA9548A

连同 ads1100 adc: https ://www.ti.com/lit/ds/symlink/ads1100.pdf?ts=1634723422799&ref_url=https%253A%252F%252Fwww.google.com%252F

在 RPI4 上。使用 adafruit 提供的 i2c 扫描仪可以很好地识别 tca9548 和 ads1100: https ://github.com/adafruit/Adafruit_CircuitPython_TCA9548A/blob/main/examples/tca9548a_simpletest.py

但是,我不能使用 smbus 库通过以下代码示例访问 adc: https ://github.com/ControlEverythingCommunity/ADS1100/blob/master/Python/ADS1100.py

因为我无法将 tca[0] 对象提供给 # Get I2C bus bus = smbus.SMBus(1)

它只接受整数。有什么想法可以使用 adafruit 库指向 ads1100 寄存器吗?

本主题解决了它:How to read from multiplexer with python I2C TCA9548A

标签: pythonraspberry-pii2c

解决方案


推荐阅读