From fe7365015dfee7bce8ab1da42a2f86b4396893c0 Mon Sep 17 00:00:00 2001 From: Bertrand Lemasle Date: Sun, 18 Aug 2019 17:20:36 +0200 Subject: [PATCH] Added missing parentheses around digitalRead comparaison. Fixes #6 --- src/MCP23017.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MCP23017.cpp b/src/MCP23017.cpp index 57d2392..293675d 100644 --- a/src/MCP23017.cpp +++ b/src/MCP23017.cpp @@ -72,7 +72,7 @@ uint8_t MCP23017::digitalRead(uint8_t pin) } gpio = readRegister(gpioreg); - if(gpio & _BV(pin) == _BV(pin)) return HIGH; + if((gpio & _BV(pin)) == _BV(pin)) return HIGH; return LOW; }