keybrd library is an open source library for creating custom-keyboard firmware.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

keybrd_1_breadboard.ino 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /* keybrd_1_breadboard.ino
  2. | Layout | **0** | **1** |
  3. |:------:|-------|-------|
  4. | **0** | 1 | a |
  5. | **1** | 2 | b |
  6. */
  7. // ################## GLOBAL ###################
  8. // ================= INCLUDES ==================
  9. #include <Scanner_uC.h>
  10. #include <ScanDelay.h>
  11. #include <Code_Sc.h>
  12. #include <Row.h>
  13. // ============ SPEED CONFIGURATION ============
  14. ScanDelay scanDelay(9000);
  15. // ================== SCANNER ==================
  16. uint8_t readPins[] = {14, 15};
  17. uint8_t readPinCount = sizeof(readPins)/sizeof(*readPins);
  18. Scanner_uC scanner(LOW, readPins, readPinCount);
  19. // =================== CODES ===================
  20. Code_Sc s_a(KEY_A);
  21. Code_Sc s_b(KEY_B);
  22. Code_Sc s_1(KEY_1);
  23. Code_Sc s_2(KEY_2);
  24. // =================== ROWS ====================
  25. Key* ptrsKeys_0[] = { &s_1, &s_a };
  26. uint8_t keyCount_0 = sizeof(ptrsKeys_0)/sizeof(*ptrsKeys_0);
  27. Row row_0(scanner, 0, ptrsKeys_0, keyCount_0);
  28. Key* ptrsKeys_1[] = { &s_2, &s_b };
  29. uint8_t keyCount_1 = sizeof(ptrsKeys_1)/sizeof(*ptrsKeys_1);
  30. Row row_1(scanner, 1, ptrsKeys_1, keyCount_1);
  31. // ################### MAIN ####################
  32. void setup()
  33. {
  34. Keyboard.begin();
  35. }
  36. void loop()
  37. {
  38. row_0.process();
  39. row_1.process();
  40. scanDelay.delay();
  41. }