|
@ -137,7 +137,11 @@ class DHTSensor : public BaseSensor { |
|
|
pinMode(_gpio, OUTPUT); |
|
|
pinMode(_gpio, OUTPUT); |
|
|
noInterrupts(); |
|
|
noInterrupts(); |
|
|
digitalWrite(_gpio, LOW); |
|
|
digitalWrite(_gpio, LOW); |
|
|
delayMicroseconds(_type == DHT_CHIP_DHT11 ? 20000 : 500); |
|
|
|
|
|
|
|
|
if (_type == DHT_CHIP_DHT11) { |
|
|
|
|
|
delay(20); |
|
|
|
|
|
} else { |
|
|
|
|
|
delayMicroseconds(500); |
|
|
|
|
|
} |
|
|
digitalWrite(_gpio, HIGH); |
|
|
digitalWrite(_gpio, HIGH); |
|
|
delayMicroseconds(40); |
|
|
delayMicroseconds(40); |
|
|
pinMode(_gpio, INPUT_PULLUP); |
|
|
pinMode(_gpio, INPUT_PULLUP); |
|
|