#include <DHTesp.h>
DHTesp dht;
TempAndHumidity data;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
dht.setup(26, DHTesp::DHT22);
pinMode(14, OUTPUT);
}
void loop() {
data = dht.getTempAndHumidity();
Serial.println("Humidity is: " + String(data.humidity));
Serial.println("Temperature is: " + String(data.temperature));
delay(250); // this speeds up the simulation
if (data.temperature >= 50) {
digitalWrite(14, HIGH);
} else {
digitalWrite(14, LOW);
}
delay(5000);
}