Advertisement
asselinpaul

RFID Spoofer Keypad Test

Jan 3rd, 2012
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.04 KB | None | 0 0
  1. /* @file CustomKeypad.pde
  2. || @version 1.0
  3. || @author Alexander Brevig
  4. || @contact alexanderbrevig@gmail.com
  5. ||
  6. || @description
  7. || | Demonstrates changing the keypad size and key values.
  8. || #
  9. */
  10. #include <Keypad.h>
  11.  
  12. const byte ROWS = 5; //five rows
  13. const byte COLS = 4; //four columns
  14. char hexaKeys[ROWS][COLS] = {
  15.   {
  16.     '1','2','3','A'                  }
  17.   ,
  18.   {
  19.     '4','5','6','B'                  }
  20.   ,
  21.   {
  22.     '7','8','9','C'                  }
  23.   ,
  24.   {
  25.     '*','0','#','D'                  }
  26.   ,
  27.   {
  28.     'N','M','F','E'                  }
  29.   ,
  30.  
  31. };
  32. byte rowPins[ROWS] = {
  33.   10, 11, 8, 17, 15}; //connect to the row pinouts of the keypad
  34. byte colPins[COLS] = {
  35.   12, 7, 16, 18}; //connect to the column pinouts of the keypad
  36.  
  37.  
  38. //initialize an instance of class NewKeypad
  39. Keypad cusomKeypad = Keypad( makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS);
  40.  
  41. void setup(){
  42.   Serial.begin(9600);
  43. }
  44.  
  45. void loop(){
  46.   char customKey = cusomKeypad.getKey();
  47.  
  48.   if (customKey != NO_KEY){
  49.     Serial.println(customKey);
  50.   }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement