Python library for AW9523 GPIO expander and LED driver
Project description
Introduction
Python library for AW9523 GPIO expander and LED driver
Dependencies
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.
Installing from PyPI
On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally from PyPI. To install for current user:
pip3 install adafruit-circuitpython-aw9523
To install system-wide (this may be required in some cases):
sudo pip3 install adafruit-circuitpython-aw9523
To install in a virtual environment in your current project:
mkdir project-name && cd project-name
python3 -m venv .venv
source .venv/bin/activate
pip3 install adafruit-circuitpython-aw9523
Usage Example
import board
import digitalio
import adafruit_aw9523
i2c = board.I2C()
aw = adafruit_aw9523.AW9523(i2c)
led_pin = aw.get_pin(0) # LED on AW9523 io 0
button_pin = aw.get_pin(1) # Button on AW io 1
# LED is an output, initialize to high
led_pin.switch_to_output(value=True)
# Button is an input, note internal pull-ups are not supported!
button_pin.direction = digitalio.Direction.INPUT
while True:
# LED mirrors button pin
led_pin.value = button_pin.value
Documentation
API documentation for this library can be found on Read the Docs.
For information on building library documentation, please check out this guide.
Contributing
Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for adafruit-circuitpython-aw9523-1.1.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a588bfda8dc30b3cfe2269b31b547a2af628fc1665a7d7d9812b5893c969aa0 |
|
MD5 | e877eff1e0853b7701bb7342f54a14a8 |
|
BLAKE2b-256 | 1f63fdc43651c7deb7d96763d2f4ba685f4489e7d481910e66a5a9c6af307668 |
Hashes for adafruit_circuitpython_aw9523-1.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b1aad63c478f8a7a0e4ba78a2cda3f7aa5824e299ae04fb1750840133f5fe5d8 |
|
MD5 | d9a61de695f3faab986f51ab9ac9e1d4 |
|
BLAKE2b-256 | ff876765a9c845dfb8bf12cd7683a52a94bf614c9bce2505a717cc5aaf30a263 |