Browse Source

Using delay instead of delayMicroseconds on DHT warmup delay

i18n
Xose Pérez 7 years ago
parent
commit
b9e158efe4
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      code/espurna/sensors/DHTSensor.h

+ 5
- 1
code/espurna/sensors/DHTSensor.h View File

@ -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);


Loading…
Cancel
Save