Skip to content

Commit 1552cb6

Browse files
authored
Merge pull request #9 from FoamyGuy/read_pin_return_bool
return bool from read_pin()
2 parents d3e5c4b + 82f8da9 commit 1552cb6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

adafruit_pcf8574.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def write_pin(self, pin: int, val: bool) -> None:
9090

9191
def read_pin(self, pin: int) -> bool:
9292
"""Read a single GPIO pin as high/pulled-up or driven low"""
93-
return (self.read_gpio() >> pin) & 0x1
93+
return ((self.read_gpio() >> pin) & 0x1) == 1
9494

9595

9696
"""

0 commit comments

Comments
 (0)