Archived
1
0
This repo is archived. You can view files and clone it, but cannot push or open issues or pull requests.
keybrd/tutorials/keybrd_1_breadboard/keybrd_1_breadboard.ino

52 lines
1.2 KiB
Arduino
Raw Normal View History

2016-07-18 02:26:00 +00:00
/* keybrd_1_breadboard.ino
| Layout | **0** | **1** |
|:------:|-------|-------|
| **0** | 1 | 2 |
| **1** | a | b |
2016-07-18 02:26:00 +00:00
*/
// ################## GLOBAL ###################
// ================= INCLUDES ==================
#include <Code_Sc.h>
#include <Row.h>
#include <Scanner_uC.h>
#include <ScanDelay.h>
2016-07-18 02:26:00 +00:00
// ============ SPEED CONFIGURATION ============
ScanDelay scanDelay(9000);
// ================== SCANNER ==================
2016-07-18 02:26:00 +00:00
uint8_t readPins[] = {14, 15};
uint8_t readPinCount = sizeof(readPins)/sizeof(*readPins);
Scanner_uC scanner(LOW, readPins, readPinCount);
2016-07-18 02:26:00 +00:00
// =================== CODES ===================
Code_Sc s_a(KEY_A);
Code_Sc s_b(KEY_B);
Code_Sc s_1(KEY_1);
Code_Sc s_2(KEY_2);
2016-07-18 02:26:00 +00:00
// =================== ROWS ====================
Key* ptrsKeys_0[] = { &s_1, &s_2 };
uint8_t keyCount_0 = sizeof(ptrsKeys_0)/sizeof(*ptrsKeys_0);
Row row_0(scanner, 0, ptrsKeys_0, keyCount_0);
2016-07-18 02:26:00 +00:00
Key* ptrsKeys_1[] = { &s_a, &s_b };
uint8_t keyCount_1 = sizeof(ptrsKeys_1)/sizeof(*ptrsKeys_1);
Row row_1(scanner, 1, ptrsKeys_1, keyCount_1);
2016-07-18 02:26:00 +00:00
// ################### MAIN ####################
void setup()
{
Keyboard.begin();
}
void loop()
{
row_0.process();
row_1.process();
scanDelay.delay();
}