-
Notifications
You must be signed in to change notification settings - Fork 0
/
code
40 lines (37 loc) · 757 Bytes
/
code
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
#include <Keyboard.h>
int go = 9;
int stop = 8;
int fade = 7;
int up = 6;
int down = 5;
void setup() {
pinMode(go, INPUT_PULLUP);
pinMode(stop, INPUT_PULLUP);
pinMode(fade, INPUT_PULLUP);
pinMode(up, INPUT_PULLUP);
pinMode(down, INPUT_PULLUP);
} //void setup()
void loop() {
if (digitalRead(go) == 0) {
Keyboard.write(32);
delay(100);
while (!digitalRead(go)){}
delay(100);
}
if (digitalRead(stop) == 0) {
Keyboard.write(KEY_ESC);
delay(300);
}
if (digitalRead(fade) == 0) {
Keyboard.write(48);
delay(300);
}
if (digitalRead(up) == 0) {
Keyboard.write(KEY_UP_ARROW);
delay(300);
}
if (digitalRead(down) == 0) {
Keyboard.write(KEY_DOWN_ARROW);
delay(300);
}
} // void loop()