#include <keypad.h>
byte rows=5;
byte cols=3;
char keys[rows][cols]={
{'1','2','3'},
{'4','5','6'},
{'#','0','*',}
};
byte rpins[ROWS]={8,7,6,5};
byte cpins[COLS]={4,3,2};
keypad keypad =keypad(makekeymap(keys),rpins,cpins,rows,cols);
void setup() {
Serial.begin(9600);
}
void loop() {
char key=keypad.getkey();
if (key!=no_key)
Serial.println(println(key));
}