Skip to content

Commit 93aed21

Browse files
committed
fix first read issue
1 parent 23254ca commit 93aed21

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

adafruit_dht.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def measure(self):
138138
delay_between_readings = 0.5
139139
if self._dht11:
140140
delay_between_readings = 1.0
141-
if time.monotonic()-self._last_called > delay_between_readings:
141+
if (self._last_called == 0) or (time.monotonic()-self._last_called > delay_between_readings):
142142
self._last_called = time.monotonic()
143143

144144
pulses = self._get_pulses()

0 commit comments

Comments
 (0)