forked from kernelcon/hacker-hotkey
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhackerHotKey.ino
68 lines (63 loc) · 1.45 KB
/
hackerHotKey.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
65
66
67
68
/* Hacker HotKey sample firmware
*
* Copyright 2021 Kernelcon
* SPDX-License-Identifier: Apache-2.0
*
* Button layout is top to bottom, left to right. So..
* 1 2 3 4
* 5 6 7 8
*/
#include <Keyboard.h>
#define BTN1 13
#define BTN2 5
#define BTN3 10
#define BTN4 9
#define BTN5 8
#define BTN6 6
#define BTN7 12
#define BTN8 4
void setup() {
pinMode(BTN1, INPUT_PULLUP);
pinMode(BTN2, INPUT_PULLUP);
pinMode(BTN3, INPUT_PULLUP);
pinMode(BTN4, INPUT_PULLUP);
pinMode(BTN5, INPUT_PULLUP);
pinMode(BTN6, INPUT_PULLUP);
pinMode(BTN7, INPUT_PULLUP);
pinMode(BTN8, INPUT_PULLUP);
Keyboard.begin();
}
void loop() {
if (digitalRead(BTN1) == LOW) {
Keyboard.println("https://kernelcon.org");
delay(200);
}
else if (digitalRead(BTN2) == LOW) {
Keyboard.println("https://twitch.kernelcon.org");
delay(200);
}
else if (digitalRead(BTN3) == LOW) {
Keyboard.println("https://discord.kernelcon.org");
delay(200);
}
else if (digitalRead(BTN4) == LOW) {
Keyboard.println("https://github.com/kernelcon/hacker-hotkey");
delay(200);
}
else if (digitalRead(BTN5) == LOW) {
Keyboard.println("!vote 4");
delay(200);
}
else if (digitalRead(BTN6) == LOW) {
Keyboard.println("!vote 3");
delay(200);
}
else if (digitalRead(BTN7) == LOW) {
Keyboard.println("!vote 2");
delay(200);
}
else if (digitalRead(BTN8) == LOW) {
Keyboard.println("!vote 1");
delay(200);
}
}