#include <Keypad.h>
const uint8_t ROW =4 ;
const uint8_t CLMN =4 ;
char keys[ROW][CLMN]={{'1','2','3','A'},
{'4','5','6','B'},
{'7','8','9','C'},
{'*','0','#','D'}};
const uint8_t rowpin[ROW]={9,8,7,6};
const uint8_t clmpin[CLMN]={5,4,3,2};
Keypad keypad =(keypad)(makeKeymap(keys),rowpin,clmpin,ROW,CLMN);
void setup(){
Serial.begin(9600);
}
void loop(){
char key=keypad.getKey();//capital K
if(key!=NO_KEY)
Serial.println(key);
}