-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwallcade_control.ino
64 lines (61 loc) · 1.13 KB
/
wallcade_control.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
void setup(){
for(int x=0; x<26; x++){
pinMode(x, INPUT_PULLUP);
}
}
void loop(){
//Up
if(!digitalRead(0)){
Joystick.button(1,1);
}else if(digitalRead(0)){
Joystick.button(1,0);
}
//Down
if(!digitalRead(1)){
Joystick.button(2,1);
}else if(digitalRead(1)){
Joystick.button(2,0);
}
//Left
if(!digitalRead(2)){
Joystick.button(3,1);
}else if(digitalRead(2)){
Joystick.button(3,0);
}
//Right
if(!digitalRead(3)){
Joystick.button(4,1);
}else if(digitalRead(3)){
Joystick.button(4,0);
}
//Button 1
if(!digitalRead(4)){
Joystick.button(5,1);
}else if(digitalRead(4)){
Joystick.button(5,0);
}
//Button 2
if(!digitalRead(5)){
Joystick.button(6,1);
}else if(digitalRead(5)){
Joystick.button(6,0);
}
//Button 3
if(!digitalRead(6)){
Joystick.button(7,1);
}else if(digitalRead(6)){
Joystick.button(7,0);
}
//Start
if(!digitalRead(7)){
Joystick.button(8,1);
}else if(digitalRead(7)){
Joystick.button(8,0);
}
//Coin
if(!digitalRead(24)){
Joystick.button(16,1);
}else if(digitalRead(24)){
Joystick.button(16,0);
}
}