CircuitPython library for TCA9534 Low Voltage 8-Bit I2C and SMBUS Low-Power I/O Expander with Interrupt Output and Configuration Registers.
This driver depends on:
Please ensure all dependencies are available on the CircuitPython filesystem. This is easily achieved by downloading the Adafruit library and driver bundle or individual libraries can be installed using circup.
Note
This library is not available on PyPI yet. Install documentation is included as a standard element. Stay tuned for PyPI availability!
On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally from PyPI. To install for current user:
pip3 install Community-circuitpython-tca9534
To install system-wide (this may be required in some cases):
sudo pip3 install Community-circuitpython-tca9534
To install in a virtual environment in your current project:
mkdir project-name && cd project-name
python3 -m venv .env
source .env/bin/activate
pip3 install Community-circuitpython-tca9534
Make sure that you have circup
installed in your Python environment.
Install it with the following command if necessary:
pip3 install circup
With circup
installed and your CircuitPython device connected use the
following command to install:
circup install tca9534
Or the following command to update an existing version:
circup update
#Demo of reading GPIO's status in TCA9534 bus-expander
from adafruit_bus_device.i2c_device import I2CDevice
import board
import busio
import time
import community_tca9534
# Create I2C bus.
i2c = busio.I2C(board.SCL, board.SDA)
# Create bus-expander instance.
tca9534 = community_tca9534.TCA9534(i2c)
# Main loop prints the GPIO zero status every half a second:
while True:
gpio_zero_status = tca9534.get_gpio(0)
print("GPIO zero status: {0}".format(gpio_zero_status))
# Delay for half a second.
time.sleep(0.5)
More examples are available in the examples directory.
Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.
For information on building library documentation, please check out this guide.