Skip to content
This repository was archived by the owner on Jun 26, 2021. It is now read-only.

Commit c7c77f4

Browse files
committed
Changed readGPIO(void) to read the MCP23008_GPIO register instead of the output latch register (MCP23008_OLAT).
1 parent 183b076 commit c7c77f4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Adafruit_MCP23008.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ void Adafruit_MCP23008::pinMode(uint8_t p, uint8_t d) {
8989
}
9090

9191
uint8_t Adafruit_MCP23008::readGPIO(void) {
92-
// read the current GPIO output latches
93-
return read8(MCP23008_OLAT);
92+
// read the current GPIO input
93+
return read8(MCP23008_GPIO);
9494
}
9595

9696
void Adafruit_MCP23008::writeGPIO(uint8_t gpio) {

0 commit comments

Comments
 (0)