// include the library code:
#include <WiFi.h>
#include "time.h"
#include <LiquidCrystal.h>
#include <LiquidMenu.h>
#include <Keypad.h>
bool isIntrct = false;
const char* ssid = "Wokwi-GUEST";
const char* password = "";
const char* ntpServer = "pool.ntp.org";
const long gmtOffset_sec = 0;
const int daylightOffset_sec = -14400;
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(19, 18, 5, 4, 2, 15);
const int ROW_NUM = 4; //four rows
const int COLUMN_NUM = 3; //four columns
char keys[ROW_NUM][COLUMN_NUM] = {
{'1','2','3'},
{'4','5','6'},
{'7','8','9'},
{'*','0','#'}
};
byte pin_rows[ROW_NUM] = {13, 12, 14, 27}; //connect to the row pinouts of the keypad
byte pin_column[COLUMN_NUM] = {26, 25, 33}; //connect to the column pinouts of the keypad
Keypad keypad = Keypad( makeKeymap(keys), pin_rows, pin_column, ROW_NUM, COLUMN_NUM );
/////////////////////////////////////////////////////////
// ----- Status Screen -----
// a line of one string literal
LiquidLine status1(0, 0, "Stnby");
LiquidLine status2(0, 1, "04/20/2022 Ready");
// create a screen from the above lines
LiquidScreen statusMain(status1, status2);
// ----- MENU -----
// create a menu from the screens
LiquidMenu menu(lcd, statusMain);
/////////////////////////////////////////////////////////
void setup() {
Serial.begin(9600);
keypad.setDebounceTime(250);
keypad.setHoldTime(500);
WiFi.begin(ssid);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected.");
// Init and get the time
configTime(gmtOffset_sec, daylightOffset_sec, ntpServer);
//printLocalTime();
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
lcd.home();
lcd.print("Testing...");
lcd.setCursor(0,1);
lcd.print("123");
delay(1000);
lcd.clear();
}
void loop() {
char key = keypad.getKey();
if (key)
{lcd.print(key)}
if (isIntrct)
if (isIntrct)
if (isIntrct)
/*
if (key){
lcd.clear();
lcd.print(key);
}
else {
menu.update();
}
*/
delay(1000);
}