Skip to content

Commit cad6977

Browse files
Timo WitteTimo Witte
authored andcommitted
fix initilization of _lastreadtime
1 parent 53375d8 commit cad6977

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

DHT.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ void DHT::begin(void) {
2727
// Using this value makes sure that millis() - lastreadtime will be
2828
// >= MIN_INTERVAL right away. Note that this assignment wraps around,
2929
// but so will the subtraction.
30-
_lastreadtime = -MIN_INTERVAL;
30+
_lastreadtime = millis()-MIN_INTERVAL;
3131
DEBUG_PRINT("Max clock cycles: "); DEBUG_PRINTLN(_maxcycles, DEC);
3232
}
3333

0 commit comments

Comments
 (0)