File tree Expand file tree Collapse file tree 1 file changed +16
-5
lines changed
libraries/USBHID/examples/Keyboard Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Original file line number Diff line number Diff line change 1+ /* *************************************************************
2+ ** Brief introduction to a few HID Keyboard commands. **
3+ ** Unlike the other Keyboard library, this one doesn't use **
4+ ** the "press", "release", and "send" commands. **
5+ **************************************************************/
6+
17#include " PluggableUSBHID.h"
28#include " USBKeyboard.h"
39
410USBKeyboard Keyboard;
511
6- void setup () {
7- // put your setup code here, to run once:
12+ // Arbitrary pin.
13+ const int CONTROL_PIN = 2 ;
814
15+ void setup () {
16+ // We will use this to start/end the prints.
17+ pinMode (CONTROL_PIN, INPUT_PULLUP);
918}
1019
1120void loop () {
12- // put your main code here, to run repeatedly:
13- delay (1000 );
14- Keyboard.printf (" Hello world\n\r " );
21+ // This will run only if the control pin is connected to ground.
22+ if ( digitalRead (CONTROL_PIN) == LOW){
23+ delay (1000 );
24+ Keyboard.printf (" Hello world\n\r " );
25+ }
1526}
You can’t perform that action at this time.
0 commit comments