#include <LiquidCrystal_I2C.h>
#include <DHT.h>
#define dht_pin 4
#define DHTTYPE DHT11
LiquidCrystal_I2C lcd (0x27,16, 2);
DHT dht(dht_pin,DHTTYPE);
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
lcd.begin(16,2);
lcd.init();
lcd.backlight();
dht.begin();
}
void loop() {
int teplota = dht.readTemperature();
int vlhkost = dht.readHumidity();
Serial.print("Teplota: ");
Serial.println(teplota);
Serial.print("Vlhkost: ");
Serial.println(vlhkost);
Serial.println("///////////////////////////");
lcd.setCursor(0,0);
lcd.print(teplota);
lcd.setCursor(0,1);
lcd.print(vlhkost);
delay(1000);
lcd.clear();
}