#include "DHTesp.h"
#include <LiquidCrystal_I2C.h>
DHTesp dhtSensor;
LiquidCrystal_I2C lcd(0x27,16,2);
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
dhtSensor.setup(26, DHTesp::DHT22);
lcd.init();
lcd.backlight();
}
void loop() {
TempAndHumidity data = dhtSensor.getTempAndHumidity();
lcd.setCursor(0,0);
lcd.print("Temp: " + String(data.temperature, 2) + "C");
lcd.setCursor(0,1);
lcd.print("Humidity: " + String(data.humidity, 1) + "%");
delay(2000);
// put your main code here, to run repeatedly:
// this speeds up the simulation
}