Advertisement
carcyn

Untitled

Feb 19th, 2020
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. #include <Wire.h>
  2. #include <LiquidCrystal_I2C.h>
  3. //#define Password_Length 8
  4. #include <Keypad.h>
  5.  
  6. const byte ROWS = 4;
  7. const byte COLS = 4;
  8.  
  9. char hexaKeys[ROWS][COLS] = {
  10. {'1', '2', '3', 'A'},
  11. {'4', '5', '6', 'B'},
  12. {'7', '8', '9', 'C'},
  13. {'*', '0', '#', 'D'}
  14. };
  15.  
  16. byte rowPins[ROWS] = {9, 8, 7, 6};
  17. byte colPins[COLS] = {5, 4, 3, 2};
  18.  
  19. Keypad customKeypad = Keypad(makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS);
  20.  
  21. void setup(){
  22. Serial.begin(9600);
  23. }
  24.  
  25. void loop(){
  26. char customKey = customKeypad.getKey();
  27.  
  28. if (customKey){
  29. Serial.println(customKey);
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement