#include"DHTesp.h"
DHTesp dhtSensor;
TempAndHumidity data;
const int DHT_PIN=15;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
dhtSensor.setup(DHT_PIN,DHTesp::DHT22);
}
void loop() {
// put your main code here, to run repeatedly:
data=dhtSensor.getTempAndHumidity();
// this speeds up the simulation
Serial.println("Humidity:"+String(data.humidity,1));
Serial.println("Temperature:"+String(data.temperature,2));
Serial.println("---------");
delay(1000);
}