Skip to content

Commit 2efb50e

Browse files
authored
Update KeyboardLogout.ino
Adds <buttonPin> to keep code standard
1 parent 3ef1fe6 commit 2efb50e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

libraries/USB/examples/Keyboard/KeyboardLogout/KeyboardLogout.ino

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,18 @@ USBHIDKeyboard Keyboard;
4141
// change this to match your platform:
4242
int platform = OSX;
4343

44+
const int buttonPin = 0; // input pin for pushbutton
45+
4446
void setup() {
4547
// make pin 0 an input and turn on the pull-up resistor so it goes high unless
4648
// connected to ground:
47-
pinMode(0, INPUT_PULLUP);
49+
pinMode(buttonPin, INPUT_PULLUP);
4850
Keyboard.begin();
4951
USB.begin();
5052
}
5153

5254
void loop() {
53-
while (digitalRead(0) == HIGH) {
55+
while (digitalRead(buttonPin) == HIGH) {
5456
// do nothing until pin 2 goes low
5557
delay(500);
5658
}

0 commit comments

Comments
 (0)