#include <LiquidCrystal_I2C.h>
#include <WiFi.h>
LiquidCrystal_I2C lcd(0x27, 20, 4);
void spinner() {
static int8_t counter = 0;
const char* glyphs = "\xa1\xa5\xdb";
lcd.setCursor(19, 1);
lcd.print(glyphs[counter++]);
if (counter == strlen(glyphs)) {
counter = 0;
}
}
void setup() {
lcd.init();
lcd.backlight();
lcd.setCursor(2,2);
lcd.print("ENGINEERING MONK");
delay(5000);
lcd.clear();
lcd.print("Connecting to ");
lcd.setCursor(0, 1);
lcd.print("WiFi ");
WiFi.begin("Wokwi-GUEST", "", 6);
while (WiFi.status() != WL_CONNECTED) {
delay(250);
spinner();
}
lcd.clear();
lcd.setCursor(0, 1);
lcd.print("WiFi Connected");
Serial.println("");
Serial.println("WiFi connected");
delay(5000);
lcd.clear();
}
void loop() {
//lcd.clear();
lcd.setCursor(1,0);
lcd.print("Current Consumption");
lcd.setCursor(2,1);
lcd.print("Face 1 : 0.0 U");
lcd.setCursor(2,2);
lcd.print("Face 2 : 0.0 U");
lcd.setCursor(2,3);
lcd.print("Face 3 : 0.0 U");
}