#include <LiquidCrystal_I2C.h>
#include <DHT.h>
#define DHTPIN 10
#define DHTTYPE DHT22
DHT dht(DHTPIN, DHT22);
LiquidCrystal_I2C lcd(0x27,20,4);
int chk;
float hum;
float temp;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
dht.begin();
lcd.init();
lcd.backlight();
lcd.setCursor(6,0);
lcd.println("Informasi");
lcd.setCursor(1,2);
lcd.println("Suhu dan Kelembaban");
delay(3000);
lcd.clear();
}
void loop() {
// put your main code here, to run repeatedly:
hum = dht.readHumidity();
temp = dht.readTemperature();
lcd.init();
lcd.backlight();
lcd.setCursor(8,0);
lcd.print("Arya");
lcd.setCursor(1,1);
lcd.print("Suhu : ");
lcd.print(temp);
lcd.print("C");
lcd.println();
lcd.setCursor(1,2);
lcd.print("Kelembaban: ");
lcd.print(hum);
lcd.print("%");
lcd.println();
delay(3000);
}