Python Tools for the MCP23008 and MCP23017 I2C IO Expanders
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Python MCP230XX I2C IO Expander Tools

A couple of basic tools I knocked up while playing with the MCP23017 on my Raspberry Pi. More info on my blog here:
A simple command line tool for setting outputs as high or low.

Usage: -b <bank> -o <output> -s <high|low>

eg. to set GPA1 high: -b a -o 1 -s high

Response: Output GPA1 changed to high

Requires python-smbus


A web interface using Python and modwsgi. Can be controlled through the built in web form or via GET requests with optional JSON like responses. 

eg. to set output GPA1 high: 

Response: {"GPA1":"HIGH"}

Requires python-smbus and apache with mod-wsgi. Note that you will need to make sure your web server has permissions for the i2c bus, eg. /dev/i2c-0

To do: Extend to cater for input as well as output and report on the current state of the outputs.