//Library LCD
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);

//Library DHT 22
#include <DHT.h>
#define DHTPIN 13
#define DHTTYPE DHT22
DHT dht(DHTPIN, DHTTYPE);

void setup(){
  Serial.begin(9600);
  dht.begin();
  lcd.init();
  lcd.backlight();

 
  lcd.setCursor(2, 0);
  lcd.print("HALLO SEMUA!"); //(16-12):2 untuk mucul di tengah
  delay(2000);
  lcd.clear();
  lcd.setCursor(1, 0);
  lcd.print("SELAMAT DATANG");
  lcd.setCursor(0, 1);
  lcd.print("DI PELATIHAN IoT");
  delay(4000);
  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print("PENGUKURAN  SUHU");
  lcd.setCursor(1, 1);
  lcd.print("DAN KELEMBAPAN");
  delay(4000);
  lcd.clear();
}

void loop(){
  float humidity = dht.readHumidity();
  double temperature = dht.readTemperature();

  lcd.setCursor(0, 0); 
  lcd.print(F("Suhu      : "));
  lcd.print(temperature);
  lcd.setCursor(0, 1);
  lcd.print(F("Kelembapan: "));
  lcd.print(humidity);
}