#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,20,4);
#include <Keypad.h>
const byte ROWS = 4;
const byte COLS = 4;
char hexaKeys [ROWS] [COLS] = {
{'1', '2', '3', 'A'},
{'4', '5', '6', 'B'},
{'7', '8', '9', 'C'},
{'*', '0', '#', 'D'}
};
byte rowPin[ROWS] = {9, 8, 7, 6};
byte colPin[COLS] = {5, 4, 3, 2};
Keypad myKeypad = Keypad (makeKeymap(hexaKeys), rowPin, colPin, ROWS, COLS);
void setup() {
lcd.init();
lcd.backlight();// put your setup code here, to run once:
}
void loop() {
char val = myKeypad.getKey();
if (val) {
lcd.setCursor(0,0);
lcd.print(val);
}// put your main code here, to run repeatedly:
}