Professional Documents
Culture Documents
Keypad 4x4
Keypad 4x4
pde
|| @version 1.0
|| @author Alexander Brevig
|| @contact alexanderbrevig@gmail.com
||
|| @description
|| | Demonstrates the simplest use of the matrix Keypad library.
|| #
*/
#include <Keypad.h>
byte rowPins[ROWS] = {A3,A2,A1,A0};// Connect keypad ROW0, ROW1, ROW2 and ROW3 to
these Arduino pins.
byte colPins[COLS] = {6,5,4,3};// Connect keypad COL0, COL1 and COL2 to these
Arduino pins.
// Create the Keypad
Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
void setup(){
Serial.begin(9600);
}
void loop(){
char key = keypad.getKey();
if (key){
Serial.println(key);
}
}