From 13ffc65d46df4f9a66d8533a5131392dc57306fc Mon Sep 17 00:00:00 2001 From: Daniel Tam Date: Thu, 12 Jul 2018 18:54:25 -0500 Subject: [PATCH] added comments --- ddr-control-panel.ino | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/ddr-control-panel.ino b/ddr-control-panel.ino index 959f77d..25452a1 100644 --- a/ddr-control-panel.ino +++ b/ddr-control-panel.ino @@ -1,3 +1,19 @@ +/* + +Convert DDR control panel to buttons. +DDR control panel uses a JST YLR-12V connector +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 +Right 2 : L +Start 1 : S +Start 2 : K + +*/ + #define BT_L1 1 #define BT_L2 2 #define BT_R1 3 @@ -9,6 +25,7 @@ void setup() { + // Setup pins pinMode (BT_L1, INPUT); pinMode (BT_L2, INPUT); pinMode (BT_R1, INPUT); @@ -16,6 +33,7 @@ void setup() pinMode (BT_S1, INPUT); pinMode (BT_S2, INPUT); + // Set pins to high digitalWrite(BT_L1, HIGH); digitalWrite(BT_L2, HIGH); digitalWrite(BT_R1, HIGH); @@ -28,6 +46,7 @@ void setup() void loop() { + // Check button inputs if(digitalRead(BT_L1) == LOW) { Keyboard.press('a'); @@ -81,4 +100,4 @@ void loop() { Keyboard.release('k'); } -} +}