First make sure you are running the latest version of Adafruit CircuitPython (https://adafru.it/Amd) for your
board.
Next you'll need to install the necessary libraries to use the hardware--carefully follow the steps to find
and install these libraries from Adafruit's CircuitPython library bundle (https://adafru.it/ENC). Our
CircuitPython starter guide has a great page on how to install libraries from the library
bundle (https://adafru.it/ABU).
Copy the following file from the bundle to the lib folder on your CIRCUITPY drive:
adafruit_aw9523.mpy
Before continuing make sure your board's lib folder or root filesystem has the adafruit_aw9523.mpy file
copied over.
Python Installation of AW9523 Library
You'll need to install the Adafruit_Blinka library that provides the CircuitPython support in Python. This
may also require enabling I2C on your platform and verifying you are running Python 3. Since each
platform is a little different, and Linux changes often, please visit the CircuitPython on Linux guide to get
your computer ready (https://adafru.it/BSN)!
Once that's done, from your command line run the following command:
pip3 install adafruit-circuitpython-aw9523
If your default Python is version 3 you may need to run 'pip' instead. Just make sure you aren't trying to
use CircuitPython on Python 2.x, it isn't supported!
CircuitPython & Python Usage
To demonstrate the usage of this breakout, you have two examples to choose from: I/O using a button
and an LED, and constant current fade.
Button and LED
This example shows how you can create an output and an input on the expander. Note that this expander
does not support internal pull resistors.
Connect an LED to pin 0, with a resistor to ground, this is the output.
Connect a tactile switch with one side connected to pin 1 of the expander. Add a ~10K pull-up resistor on
the expander pin 1 to Vin. Connect the other side of the button to ground. This makes it so the button pin
is HIGH by default, and when you press the button, the pin goes LOW.