#include<Keypad.h>
#include <LiquidCrystal.h>
LiquidCrystal lcd(5,4,A0,A1,A2,A3);
char keys[4][4] = {
{'1','2','3','A'},
{'4','5','6','B'},
{'7','8','9','C'},
{'*','0','#','D'}
};
byte rowsPin[4] = {13,12,11,10};
byte colsPin[4] = {9,8,7,6};
Keypad pad = Keypad(makeKeymap(keys),rowsPin,colsPin,4,4);
void setup() {
// put your setup code here, to run once:
pinMode(5, OUTPUT);
Serial.begin(9600);
lcd.begin(16,2);
}
void loop() {
// put your main code here, to run repeatedly:
char c = pad.getKey();
if(c != NO_KEY){
Serial.print(c);
lcd.print(c);
// for(int i=1;i<(c-48)+1;i++)
// {
// digitalWrite(5, HIGH);
// delay(1000);
// digitalWrite(5, LOW);
// delay(1000);
// }
}
}