This is a library for the Adafruit MCP23017 I2C Port Expander.
This library works exclusively on the Spark, it no longer checks for Arduino to do alternate imports and definitions.
The default address of the MCP23017 is 0x20
. If you call the constructor with no parameters this address is automatically used (as set in the header).
The Power on Reset value of the I/O direction registers is 1111 1111
, which means that both banks of GPIO pins are setup as inputs. You have to explicitly set them as outputs if you want to use them as such, with setPinMode()
Currently there are no abstractions written for setting up interrupts, if someone wanted to contribute those I would happily take a pull request. The interrupt and toggle examples also need to be refactored
Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit!
Written by Limor Fried/Ladyada for Adafruit Industries.
BSD license, check license.txt for more information
All text above must be included in any redistribution
Adapted for Spark Core by Paul Kourany, Sept 3, 2014
Extended for Grove Labs by Louis DeScioli, December 2014