#include"DHTesp.h"
DHTesp sensor;
TempAndHumidity data;
int pin=12;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
sensor.setup(pin,DHTesp::DHT22);
}
void loop() {
data=sensor.getTempAndHumidity();
Serial.println(String(data.temperature)+"this is temperature");
Serial.println(" ");
Serial.println(String(data.humidity)+"this is himidity");
// put your main code here, to run repeatedly:
delay(2000); // this speeds up the simulation
}