#include <LiquidCrystal_I2C.h>
#include <WiFi.h>

LiquidCrystal_I2C lcd(0x27,16,2);

const char ssid[] = "Wokwi-GUEST";
const char pass[] = "";

void setup() {
  lcd.init();
  lcd.backlight();
  WiFi.begin(ssid, pass);

  lcd.setCursor(0,0);
  lcd.print("Welcome");
  delay(500);
  lcd.clear();

  lcd.setCursor(0,0);
  lcd.print("Menghubungkan");
  lcd.setCursor(0,1);
  lcd.print("ke WiFi");

  while (WiFi.status() != WL_CONNECTED) {
    lcd.print(".");
    delay(500);
  }
  
  lcd.clear();
  lcd.setCursor(0,0);
  lcd.print("WiFi Terhubung!");
}

void loop() {
  delay(10);
}