Python Usage
Make sure you've installed the bonnet onto your single board Linux computer by plugging it in and then restarting.
You will need to have I2C set up and activated - here's how to do it for Raspberry Pi. (https://adafru.it/dEO)
Once that's done and the bonnet installed, board rebooted, you should be able to I2C scan to find the device with
something like sudo i2c-detect -y 1 (the number may be different on non-Raspi computers)
The default address for the bonnet is 0x20
Python Installation of MCP23017 Library
You can use this Bonnet with Python and Raspberry Pi thanks to Adafruit_Blinka, our CircuitPython-for-Python
compatibility library (https://adafru.it/BSN).
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:
sudo pip3 install adafruit-circuitpython-mcp230xx
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!
Python Usage
To demonstrate the usage, we'll use Python code to read a button and light up an LED from the Python REPL.
Wire up the bonnet as follows:
LED anode through a resistor (220 to 4.7Kohm) to GPA0
LED cathode (short leg) to one of the GND pads (any)
One side of switch to GPA1
Other side of switch to one of the GND pads (any)