2016-07-18 02:26:00 +00:00
|
|
|
/* keybrd_1_breadboard.ino
|
|
|
|
|
|
|
|
| Layout | **0** | **1** |
|
|
|
|
|:------:|-------|-------|
|
2016-09-17 05:45:12 +00:00
|
|
|
| **0** | 1 | 2 |
|
|
|
|
| **1** | a | b |
|
2016-07-18 02:26:00 +00:00
|
|
|
*/
|
|
|
|
// ################## GLOBAL ###################
|
|
|
|
// ================= INCLUDES ==================
|
|
|
|
#include <Code_Sc.h>
|
2016-09-05 20:09:59 +00:00
|
|
|
#include <Row.h>
|
2016-09-06 07:08:26 +00:00
|
|
|
#include <Scanner_uC.h>
|
2016-09-17 05:45:12 +00:00
|
|
|
#include <ScanDelay.h>
|
2016-07-18 02:26:00 +00:00
|
|
|
|
|
|
|
// ============ SPEED CONFIGURATION ============
|
|
|
|
ScanDelay scanDelay(9000);
|
|
|
|
|
2016-09-05 20:09:59 +00:00
|
|
|
// ================== SCANNER ==================
|
2016-07-18 02:26:00 +00:00
|
|
|
uint8_t readPins[] = {14, 15};
|
2016-09-05 20:09:59 +00:00
|
|
|
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);
|
2016-09-05 20:09:59 +00:00
|
|
|
|
|
|
|
Code_Sc s_1(KEY_1);
|
|
|
|
Code_Sc s_2(KEY_2);
|
2016-07-18 02:26:00 +00:00
|
|
|
|
|
|
|
// =================== ROWS ====================
|
2016-09-17 05:45:12 +00:00
|
|
|
Key* ptrsKeys_0[] = { &s_1, &s_2 };
|
2016-09-05 20:09:59 +00:00
|
|
|
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
|
|
|
|
2016-09-17 05:45:12 +00:00
|
|
|
Key* ptrsKeys_1[] = { &s_a, &s_b };
|
2016-09-05 20:09:59 +00:00
|
|
|
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();
|
|
|
|
}
|