added comments
This commit is contained in:
@@ -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_L1 1
|
||||||
#define BT_L2 2
|
#define BT_L2 2
|
||||||
#define BT_R1 3
|
#define BT_R1 3
|
||||||
@@ -9,6 +25,7 @@
|
|||||||
|
|
||||||
void setup()
|
void setup()
|
||||||
{
|
{
|
||||||
|
// Setup pins
|
||||||
pinMode (BT_L1, INPUT);
|
pinMode (BT_L1, INPUT);
|
||||||
pinMode (BT_L2, INPUT);
|
pinMode (BT_L2, INPUT);
|
||||||
pinMode (BT_R1, INPUT);
|
pinMode (BT_R1, INPUT);
|
||||||
@@ -16,6 +33,7 @@ void setup()
|
|||||||
pinMode (BT_S1, INPUT);
|
pinMode (BT_S1, INPUT);
|
||||||
pinMode (BT_S2, INPUT);
|
pinMode (BT_S2, INPUT);
|
||||||
|
|
||||||
|
// Set pins to high
|
||||||
digitalWrite(BT_L1, HIGH);
|
digitalWrite(BT_L1, HIGH);
|
||||||
digitalWrite(BT_L2, HIGH);
|
digitalWrite(BT_L2, HIGH);
|
||||||
digitalWrite(BT_R1, HIGH);
|
digitalWrite(BT_R1, HIGH);
|
||||||
@@ -28,6 +46,7 @@ void setup()
|
|||||||
|
|
||||||
void loop()
|
void loop()
|
||||||
{
|
{
|
||||||
|
// Check button inputs
|
||||||
if(digitalRead(BT_L1) == LOW)
|
if(digitalRead(BT_L1) == LOW)
|
||||||
{
|
{
|
||||||
Keyboard.press('a');
|
Keyboard.press('a');
|
||||||
@@ -81,4 +100,4 @@ void loop()
|
|||||||
{
|
{
|
||||||
Keyboard.release('k');
|
Keyboard.release('k');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user