#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() {
data=dhtsensor.getTempandHumidity();
Serial.println("Temperature:"+ String(data.temperature,2)+" °C");
Serial.println("Humidity:"+ String(data.humidity,2)+" %");
Serial.println("---");// put your main code here, to run repeatedly:
delay(1000); // this speeds up the simulation
}