diff --git a/code/espurna/sensors/DHTSensor.h b/code/espurna/sensors/DHTSensor.h index ba4e48b0..101e35e6 100644 --- a/code/espurna/sensors/DHTSensor.h +++ b/code/espurna/sensors/DHTSensor.h @@ -137,7 +137,11 @@ class DHTSensor : public BaseSensor { pinMode(_gpio, OUTPUT); noInterrupts(); digitalWrite(_gpio, LOW); - delayMicroseconds(_type == DHT_CHIP_DHT11 ? 20000 : 500); + if (_type == DHT_CHIP_DHT11) { + delay(20); + } else { + delayMicroseconds(500); + } digitalWrite(_gpio, HIGH); delayMicroseconds(40); pinMode(_gpio, INPUT_PULLUP);