#include <Keypad.h>
#include <LiquidCrystal.h>
// initialize the LCD
LiquidCrystal lcd(A5, 2, 3, 4, 5, 6);
const byte rows = 4; // set display to 4 rows
const byte cols = 3; // set display to 3 columns
char keys[rows][cols] =
{{'1','2','3'},
{'4','5','6'},
{'7','8','9'},
{'*','0','#'}};
byte rowPins[rows] = {7, 8, 9, 10};
byte colPins[cols] = {11, 12, 13};
Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, rows, cols);
void setup () {
lcd.begin(16, 2);
lcd.print("Enter Number:");
delay(3000);
lcd.clear();
}
void loop() {
char key = keypad.getKey();
if (key != NO_KEY){
lcd.print(key);
}
}