//Activity 5: Array (4x4 Keypad)
//Aaron John Esguerra
//BSIS - Extension Class
#include <Keypad.h>
const uint8_t CELLA = 4;
const uint8_t CELLB = 4;
char keys[CELLA][CELLB] = {
{ '1', '2', '3', 'A' },
{ '4', '5', '6', 'B' },
{ '7', '8', '9', 'C' },
{ '*', '0', '#', 'D' }
};
uint8_t colPins[CELLB] = { 5, 4, 3, 2 };
uint8_t rowPins[CELLA] = { 9, 8, 7, 6 };
Keypad keypad = Keypad(makeKeymap(keys),
rowPins, colPins, CELLA, CELLB);
void setup() {
Serial.begin(7000);
}
void loop() {
char key = keypad.getKey();
if (key != NO_KEY) {
Serial.print(key);
}
}