/* @file CustomKeypad.pde
|| @version 1.0
|| @author Alexander Brevig
|| @contact [email protected]
||
|| @description
|| | Demonstrates changing the keypad size and key values.
|| #
*/
#include <Keypad.h>
const static int ROWS = 4, COLS = 3;
static char KEYPAD[4][3] = {
{'1', '2', '3'},
{'4', '5', '6'},
{'7', '8', '9'},
{'*', '0', '#'}
};
// NOTE: Change the pins if physical pins are changed
static byte rowPins[ROWS] = {10,9,8,7};
static byte colPins[COLS] = {6,5,4};
//initialize an instance of class NewKeypad
Keypad customKeypad = Keypad( makeKeymap(KEYPAD), rowPins, colPins, ROWS, COLS);
void setup(){
Serial.begin(9600);
}
void loop(){
char customKey = customKeypad.getKey();
if (customKey){
Serial.println(customKey);
}
}