#include <Keypad.h>
const uint8_t BARIS=4; //jml baris keypad
const uint8_t KOLOM=4; //jml kolom keypad
char keys[BARIS][KOLOM]={
{'1','2','3','A'},
{'4','5','6','B'},
{'7','8','9','C'},
{'*','0','#','D'}
};
uint8_t colPins[KOLOM]={5,4,2,15};
uint8_t rowPins[BARIS]={22,21,19,18};
Keypad keypad=Keypad(makeKeymap(keys), rowPins, colPins, BARIS, KOLOM);
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
//Serial.println("Hello, ESP32!");
}
void loop() {
// put your main code here, to run repeatedly:
//delay(10); // this speeds up the simulation
char key = keypad.getKey();
if(key != NO_KEY){
Serial.println(key);
}
}