#include <Keypad.h>
#include <LiquidCrystal_I2C.h>
const byte rows = 4;
const byte coloumns = 4;
char keypadKeys[rows][coloumns] = {
{'1','2','3','A'}, {'4','5','6','B'}, {'7','8','9','C'}, {'*','0','#','D'}
};
byte keypadPinRows[rows] = {13, 12, 11, 10};
byte keypadPinCollumns[coloumns] = {9, 8, 7, 6};
Keypad thisKeyPad = Keypad(makeKeymap(keypadKeys), keypadPinRows, keypadPinCollumns, rows, coloumns);
LiquidCrystal_I2C display(0x27, 16, 2);
void setup() {
display.init();
display.backlight();
display.setCursor(0,0);
}
void loop() {
char key = thisKeyPad.getKey();
if(key != NO_KEY){
display.print(key);
}
if (key == 'C'){
display.clear();
}
}