fixed button layout
This commit is contained in:
@@ -6,14 +6,15 @@ Pins 1-6 are used for buttons, pin 7 and 8 are GRD
|
|||||||
|
|
||||||
Button to keyboard mappings
|
Button to keyboard mappings
|
||||||
Left 1 : A
|
Left 1 : A
|
||||||
Left 2 : D
|
Left 2 : J
|
||||||
Right 1 : J
|
Right 1 : D
|
||||||
Right 2 : L
|
Right 2 : L
|
||||||
Start 1 : S
|
Start 1 : S
|
||||||
Start 2 : K
|
Start 2 : K
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// Button to pin definitions
|
||||||
#define BT_L1 1
|
#define BT_L1 1
|
||||||
#define BT_L2 2
|
#define BT_L2 2
|
||||||
#define BT_R1 3
|
#define BT_R1 3
|
||||||
@@ -21,6 +22,7 @@ Start 2 : K
|
|||||||
#define BT_S1 5
|
#define BT_S1 5
|
||||||
#define BT_S2 6
|
#define BT_S2 6
|
||||||
|
|
||||||
|
|
||||||
#include <Keyboard.h>
|
#include <Keyboard.h>
|
||||||
|
|
||||||
void setup()
|
void setup()
|
||||||
@@ -57,15 +59,6 @@ void loop()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(digitalRead(BT_L2) == LOW)
|
if(digitalRead(BT_L2) == LOW)
|
||||||
{
|
|
||||||
Keyboard.press('d');
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Keyboard.release('d');
|
|
||||||
}
|
|
||||||
|
|
||||||
if(digitalRead(BT_R1) == LOW)
|
|
||||||
{
|
{
|
||||||
Keyboard.press('j');
|
Keyboard.press('j');
|
||||||
}
|
}
|
||||||
@@ -74,6 +67,15 @@ void loop()
|
|||||||
Keyboard.release('j');
|
Keyboard.release('j');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(digitalRead(BT_R1) == LOW)
|
||||||
|
{
|
||||||
|
Keyboard.press('d');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Keyboard.release('d');
|
||||||
|
}
|
||||||
|
|
||||||
if(digitalRead(BT_R2) == LOW)
|
if(digitalRead(BT_R2) == LOW)
|
||||||
{
|
{
|
||||||
Keyboard.press('l');
|
Keyboard.press('l');
|
||||||
|
Reference in New Issue
Block a user