Skip to content

Commit 12b1570

Browse files
committed
I fixed the DHT11 NOT being refreshed at 1 second intervals.
1 parent 2295fe4 commit 12b1570

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

DHT.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ DHT::DHT(uint8_t pin, uint8_t type, uint8_t count) {
4343
(void)count; // Workaround to avoid compiler warning.
4444
_pin = pin;
4545
_type = type;
46+
// Adjust MIN_INTERVAL based on sensor type
47+
if (_type == DHT11) {
48+
_minInterval = 1000; // 1 second for DHT11
49+
} else {
50+
_minInterval = 2000; // 2 seconds for other types
51+
}
4652
#ifdef __AVR
4753
_bit = digitalPinToBitMask(pin);
4854
_port = digitalPinToPort(pin);

0 commit comments

Comments
 (0)