Skip to content

Commit

Permalink
pinMode input/output logic was reversed. Fixed #4
Browse files Browse the repository at this point in the history
  • Loading branch information
blemasle committed Feb 19, 2019
1 parent ebde707 commit 346e14d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=MCP23017
version=1.1.0
version=1.1.1
author=Bertrand Lemasle
maintainer=Bertrand Lemasle
sentence=MCP23017 I2C Port expander library.
Expand Down
4 changes: 2 additions & 2 deletions src/MCP23017.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ void MCP23017::pinMode(uint8_t pin, uint8_t mode)
}

iodir = readRegister(iodirreg);
if(mode == OUTPUT) iodir |= _BV(pin);
else iodir &= ~_BV(pin);
if(mode == OUTPUT) iodir &= ~_BV(pin);
else iodir |= _BV(pin);

writeRegister(iodirreg, iodir);
}
Expand Down

0 comments on commit 346e14d

Please sign in to comment.