#include <LiquidCrystal_I2C.h>
#include "DHTesp.h"
LiquidCrystal_I2C lcd(0x27, 16,2);
DHTesp dhtSensor;
void setup() {
lcd.init();
lcd.backlight();
dhtSensor.setup(16, DHTesp::DHt22);
}
void loop() {
TempAndHumidity data = dhtSensor.getTempAndHumidity();
String temp = String(data.temperature);
String humid = String(data.humidity);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Temp: ");
lcd.print(temp);
lcd.print(" C");
lcd.setCursor(1,0);
lcd.print("Humid: ");
lcd.print(humid);
lcd.print(" %");
}