#include <Wire.h>
#include <Keypad.h>
#include <LiquidCrystal_I2C_Hangul.h>
LiquidCrystal_I2C_Hangul LCD = LiquidCrystal_I2C_Hangul(0x27, 16, 2);
const int rows = 4 ;
const int cols = 4 ;
char keys [rows] [cols] ={
{'1','2','3','A'},
{'4','5','6','B'},
{'7','8','9','C'},
{'*','0','#','D'}
} ;
uint8_t colpins [cols] = {26,25,33,32};
uint8_t rowpins [cols] = {13,12,14,27};
Keypad keypad = Keypad(makeKeymap(keys),rowpins,colpins,rows,cols);
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
LCD.init();
LCD.backlight();
LCD.setCursor(0, 0);
LCD.print("Welcome");
LCD.setCursor(0, 1);
LCD.print("My First Project");
pinMode(2, OUTPUT);
}
void loop() {
digitalWrite(2, HIGH);
char key = keypad.getKey();
// Serial.print(key);
// delay(100);
LCD.print(key);
Serial.println(key);
delay(500);
}