#include <LiquidCrystal_I2C.h>
#include <DHT.h>
#define DHTPIN 10
#define DHTTYPE DHT22
DHT dht(DHTPIN, DHT22);
LiquidCrystal_I2C lcd(0x27,16,2);
int chk;
float hum;
float temp;
void setup() {
dht.begin();
lcd.init();
lcd.backlight();
lcd.clear();
}
void loop() {
hum = dht.readHumidity();
temp = dht.readTemperature();
lcd.init();
lcd.backlight();
//suhu
lcd.setCursor(0,0);
lcd.print("Suhu :");
lcd.print(temp);
lcd.print("C");
//kelembaban
lcd.setCursor(0,1);
lcd.print("Hum :");
lcd.print(hum);
lcd.print("%");
//delay(500);
//lcd.clear();
}