Skip to content

Commit ecb63f1

Browse files
committed
Initialize like MCP28107
1 parent ffcc55a commit ecb63f1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

adafruit_mcp230xx/mcp23008.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,11 @@ class MCP23008(MCP230XX):
5757

5858
def __init__(self, i2c, address=_MCP23008_ADDRESS):
5959
super().__init__(i2c, address)
60-
# Reset device state to all pins as inputs (safest option).
61-
self._write_u8(_MCP23008_IODIR, 0xFF)
6260

61+
# Reset to all inputs with no pull-ups and no inverted polarity.
62+
self.iodir = 0xFF
63+
self.gppu = 0x00
64+
self._write_u8(_MCP23008_IPOL, 0x00)
6365

6466
@property
6567
def gpio(self):

0 commit comments

Comments
 (0)