From c457974f748bc4b44bd20d2977b7e33666250844 Mon Sep 17 00:00:00 2001 From: Daniel Tam Date: Thu, 12 Jul 2018 19:02:36 -0500 Subject: [PATCH] fixed button layout --- ddr-control-panel.ino | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/ddr-control-panel.ino b/ddr-control-panel.ino index 25452a1..1656085 100644 --- a/ddr-control-panel.ino +++ b/ddr-control-panel.ino @@ -6,14 +6,15 @@ Pins 1-6 are used for buttons, pin 7 and 8 are GRD Button to keyboard mappings Left 1 : A -Left 2 : D -Right 1 : J +Left 2 : J +Right 1 : D Right 2 : L Start 1 : S Start 2 : K */ +// Button to pin definitions #define BT_L1 1 #define BT_L2 2 #define BT_R1 3 @@ -21,6 +22,7 @@ Start 2 : K #define BT_S1 5 #define BT_S2 6 + #include void setup() @@ -57,15 +59,6 @@ void loop() } if(digitalRead(BT_L2) == LOW) - { - Keyboard.press('d'); - } - else - { - Keyboard.release('d'); - } - - if(digitalRead(BT_R1) == LOW) { Keyboard.press('j'); } @@ -74,6 +67,15 @@ void loop() Keyboard.release('j'); } + if(digitalRead(BT_R1) == LOW) + { + Keyboard.press('d'); + } + else + { + Keyboard.release('d'); + } + if(digitalRead(BT_R2) == LOW) { Keyboard.press('l');