We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 85a8f32 + f61a510 commit a0702e3Copy full SHA for a0702e3
adafruit_dht.py
@@ -160,7 +160,15 @@ def _get_pulses_bitbang(self):
160
timestamp = time.monotonic() # take timestamp
161
dhtval = True # start with dht pin true because its pulled up
162
dhtpin.direction = Direction.INPUT
163
- dhtpin.pull = Pull.UP
+
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
172
while time.monotonic() - timestamp < 0.25:
173
if dhtval != dhtpin.value:
174
dhtval = not dhtval # we toggled
0 commit comments