File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
libraries/USB/examples/Keyboard/KeyboardReprogram Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,8 @@ void loop(){}
34
34
#include " USBHIDKeyboard.h"
35
35
USBHIDKeyboard Keyboard;
36
36
37
+ const int buttonPin = 0 ; // input pin for pushbutton
38
+
37
39
// use this option for OSX.
38
40
// Comment it out if using Windows or Linux:
39
41
char ctrlKey = KEY_LEFT_GUI;
@@ -45,14 +47,14 @@ char ctrlKey = KEY_LEFT_GUI;
45
47
void setup () {
46
48
// make pin 0 an input and turn on the pull-up resistor so it goes high unless
47
49
// connected to ground:
48
- pinMode (0 , INPUT_PULLUP);
50
+ pinMode (buttonPin , INPUT_PULLUP);
49
51
// initialize control over the keyboard:
50
52
Keyboard.begin ();
51
53
USB.begin ();
52
54
}
53
55
54
56
void loop () {
55
- while (digitalRead (0 ) == HIGH) {
57
+ while (digitalRead (buttonPin ) == HIGH) {
56
58
// do nothing until pin 0 goes low
57
59
delay (500 );
58
60
}
You can’t perform that action at this time.
0 commit comments