Adapted DHT delay values

This commit is contained in:
Kevin Veen-Birkenbach 2020-05-14 15:12:46 +02:00
parent 4576cca670
commit f7f582973b

View File

@ -177,9 +177,9 @@ void controller(void){
String getJsonDht(void){
Serial.println("Reading DHT...");
DHT dht(PIN_DHT, DHT11);
delay(600); // Somehow this delay is needed to don't get "nan" values
delay(800); // Somehow this delay is needed to don't get "nan" values
String temperature = String(dht.readTemperature());
delay(600); // Somehow this delay is needed to don't get "nan" values
delay(800); // Somehow this delay is needed to don't get "nan" values
String humidity = String(dht.readHumidity());
return "{\"temperature_celcius\":\""+ temperature +"\",\"relative_humidity\":\""+humidity+"\"}";
}