File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ void DHT::begin(void) {
27
27
// Using this value makes sure that millis() - lastreadtime will be
28
28
// >= MIN_INTERVAL right away. Note that this assignment wraps around,
29
29
// but so will the subtraction.
30
- _lastreadtime = -MIN_INTERVAL;
30
+ _lastreadtime = millis () -MIN_INTERVAL;
31
31
DEBUG_PRINT (" Max clock cycles: " ); DEBUG_PRINTLN (_maxcycles, DEC);
32
32
}
33
33
@@ -124,7 +124,7 @@ boolean DHT::read(bool force) {
124
124
// Check if sensor was read less than two seconds ago and return early
125
125
// to use last reading.
126
126
uint32_t currenttime = millis ();
127
- if (!force && ((currenttime - _lastreadtime) < 2000 )) {
127
+ if (!force && ((currenttime - _lastreadtime) < MIN_INTERVAL )) {
128
128
return _lastresult; // return last correct measurement
129
129
}
130
130
_lastreadtime = currenttime;
You can’t perform that action at this time.
0 commit comments