Skip to content

Commit a0702e3

Browse files
authored
Merge pull request #56 from yeyeto2788/fix_issue_32
Fix issue #32
2 parents 85a8f32 + f61a510 commit a0702e3

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

adafruit_dht.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,15 @@ def _get_pulses_bitbang(self):
160160
timestamp = time.monotonic() # take timestamp
161161
dhtval = True # start with dht pin true because its pulled up
162162
dhtpin.direction = Direction.INPUT
163-
dhtpin.pull = Pull.UP
163+
164+
try:
165+
dhtpin.pull = Pull.UP
166+
# Catch the NotImplementedError raised because
167+
# blinka.microcontroller.generic_linux.libgpiod_pin does not support
168+
# internal pull resistors.
169+
except NotImplementedError:
170+
dhtpin.pull = None
171+
164172
while time.monotonic() - timestamp < 0.25:
165173
if dhtval != dhtpin.value:
166174
dhtval = not dhtval # we toggled

0 commit comments

Comments
 (0)