/*Write a program to interface keypad with Arduino board and display the key pressed on
Serial monitor*/
#include <Keypad.h>
byte ROWS=4;
byte COLS=3;
char keys[ROWS] [COLS]={
{'1','2','3'},
{'4','5','6'},
{'7','8','9'},
{'#','0','*'}
};
byte rPins[ROWS]={8,7,6,5};
byte cPins[COLS]={4,3,2};
Keypad keypad=Kaypad(makeKeymap(keys),rPins,cPins,ROWS,COLS);
void setup(){
Serial.begin(9600);
}
void loop(){
char key=keypad.getKey();
if(key!=NO_KEY)
Serial.println(Key);
}