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.
1 parent de4f5f3 commit d122696Copy full SHA for d122696
adafruit_dht.py
@@ -145,7 +145,9 @@ def _get_pulses(self):
145
dhtval = not dhtval # we toggled
146
transitions.append(time.monotonic()) # save the timestamp
147
# convert transtions to microsecond delta pulses:
148
- for i in range(1, len(transitions)):
+ # use last 81 pulses
149
+ transition_start = max(1, len(transitions) - 81)
150
+ for i in range(transition_start, len(transitions)):
151
pulses_micro_sec = int(1000000 * (transitions[i] - transitions[i-1]))
152
pulses.append(min(pulses_micro_sec, 65535))
153
return pulses
0 commit comments