#include <LiquidCrystal_I2C.h>
#include "DHT.h"
#define DHTPIN 15
#define DHTTYPE DHT22
DHT dht (DHTPIN, DHTTYPE);
#define I2C_ADDR 0x27
#define LCD_COLUMNS 16
#define LCD_LINES 2
LiquidCrystal_I2C lcd(I2C_ADDR, LCD_COLUMNS, LCD_LINES);
void setup()
{
Serial.begin(115200);
Serial.println("Hello, ESP32!");
dht.begin();
lcd.init();
lcd.backlight();
}
void loop()
{
float humidity = dht.readHumidity();
lcd.setCursor(0, 1);
lcd.print("humi="+String(humidity));
delay(1000); //this speed up the simulation
}
void temp()
{
float temperatrue = dht.readTemperature();
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("temp="+String(temperatrue));
}
void humi()
{}