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 ddb9d66 commit bcdc7a7Copy full SHA for bcdc7a7
adafruit_dht.py
@@ -138,6 +138,9 @@ def measure(self):
138
delay_between_readings = 0.5
139
if self._dht11:
140
delay_between_readings = 1.0
141
+ # Initialte new reading if this is the first call or if sufficient delay
142
+ # If delay not sufficient - return previous reading.
143
+ # This allows back to back access for temperature and humidity for same reading
144
if (self._last_called == 0 or
145
(time.monotonic()-self._last_called) > delay_between_readings):
146
self._last_called = time.monotonic()
0 commit comments