Basic library of routines to interface to a Microchip MCP23017 16-bit I/O expander using an I2C interface.
Dependents: AdaFruit_RGBLCD SX1276_GPS
Fork of MCP23017 by
Diff: MCP23017.cpp
- Revision:
- 14:c8d31c67ac27
- Parent:
- 12:6d9d2b277f26
- Child:
- 15:164d420bcbcf
diff -r d57de266cf19 -r c8d31c67ac27 MCP23017.cpp --- a/MCP23017.cpp Mon Nov 29 12:46:43 2010 +0000 +++ b/MCP23017.cpp Sat Aug 02 15:00:57 2014 +0000 @@ -155,7 +155,7 @@ * pinMode */ void MCP23017::pinMode(int pin, int mode) { - if (DIR_INPUT) { + if (mode == DIR_INPUT) { shadow_IODIR |= 1 << pin; } else { shadow_IODIR &= ~(1 << pin);