// This project implements the simulation of the reading a DHT sensor using an ESP32
// The source code is available on my git repo at : https://github.com/Bamamou/DHT11_ESP32.git
// the only difference is the sensor, Here; we use a DHT11 while in Platform io we use a DHT22
#include <DHT.h>
// Set up the DHT sensor
DHT dht(4, DHT22);
float temperature ;
float humidity;
int counter;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
Serial.println("Hello, ESP32!");
}
void loop() {
hum = dht.readHumidity();
temp = dht.readTemperature();
//suhu
lcd.setCursor(0,0);
lcd.print("Suhu:");
lcd.setCursor(7,0);
lcd.print(temp);
//kelembaban
lcd.setCursor(0,1);
lcd.print("Kelembaban:");
lcd.setCursor(13,1);
lcd.print(hum);
//delay(500);
//lcd.clear();
}