#include <LiquidCrystal_I2C.h>
#include <dht.h>

dht dht22;
#define DHT22_PIN 2

LiquidCrystal_I2C lcd(0x27, 20, 4);

void setup() {

  lcd.init(); 
  lcd.backlight();

  lcd.setCursor(0, 0);            
  lcd.print("SMAN 1 TANGSEL");          
  lcd.setCursor(0, 1);            
  lcd.print("INFORMATIKA"); 
  lcd.setCursor(0, 2);            
  lcd.print("NAMA SISWA");          
  lcd.setCursor(0, 3);            
  lcd.print("KELAS X-10");   
}

void loop() {
  delay(1000); 
  int chk = dht22.read22(DHT22_PIN);

  lcd.clear();
  
  lcd.setCursor(0, 2);
  lcd.print(String("Temp : ")+String(dht22.temperature, 1));   
  lcd.setCursor(0, 3);
  lcd.print(String("Humidity : ")+String(dht22.humidity, 1));   
}