Use MIN_INTERVAL define instead of hardcoded value

This commit is contained in:
Spacefish 2015-12-26 22:32:34 +01:00
parent edcd0e06e6
commit 53375d8d70

View File

@ -124,7 +124,7 @@ boolean DHT::read(bool force) {
// Check if sensor was read less than two seconds ago and return early // Check if sensor was read less than two seconds ago and return early
// to use last reading. // to use last reading.
uint32_t currenttime = millis(); uint32_t currenttime = millis();
if (!force && ((currenttime - _lastreadtime) < 2000)) { if (!force && ((currenttime - _lastreadtime) < MIN_INTERVAL)) {
return _lastresult; // return last correct measurement return _lastresult; // return last correct measurement
} }
_lastreadtime = currenttime; _lastreadtime = currenttime;