#include <Keypad.h>
// map phím
char keys[4][4] = {
{'1','2','3','A'},
{'4','5','6','B'},
{'7','8','9','C'},
{'*','0','#','D'}
};
byte rowPins[4] = {13,12,11,10};
byte colPins[4] = {7,6,5,4};
Keypad keypad = Keypad(makeKeymap(keys), rowPins, colPins, 4,4);
void setup(){
Serial.begin(115200);
}
void loop(){
char key = keypad.getKey();
if(key){
Serial.println(key); // in phím
}
}