[Submission] MCP23008-I2C (IO Expander) Library Published

This is a port of Adafruit’s MCP28003 8-bit I2C IO Expander Arduino library. I needed it for a project I’m doing with the Spark Core, so thought I’d share it. It’s also been published through the web IDE.

Code is here: https://github.com/JBionics/MCP23008-I2C

4 Likes

Nice! Congrats.
I wonder if this will work with my PCF8574 without modding…

@henriquepss
I took a quick look at the PCF8574 datasheet. It operates differently than the MCP23008, however it’s a simpler chip to work with.

You just Wire.write() and Wire.read() to read/write IO pins. No chip configuration required.

This tutorial code runs on the spark with minimal changes:

  • remove #include <Wire.h>

  • change Wire.send() to Wire.write(), Wire.receive() to Wire.read()

1 Like

Hey,
the libary looks really nice :slight_smile:
Would it to work together with the MCP23016?
As far as I know the MCP23016 is basically just the 16 channel version of the MCP23008.