mirror of
https://github.com/arduino/Arduino.git
synced 2025-02-26 20:54:22 +01:00
Modified Keyboard Reprogram example
Updated to reflect changes with how the IDE creates new blank sketches.
This commit is contained in:
parent
3adbeeeaf8
commit
cf5fc143ac
@ -11,12 +11,14 @@
|
||||
a final key combination (CTRL-U).
|
||||
|
||||
Circuit:
|
||||
* Arduino Leonardo or Micro
|
||||
* Arduino Leonardo, Micro, Due, LilyPad USB, or Yun
|
||||
* wire to connect D2 to ground.
|
||||
|
||||
created 5 Mar 2012
|
||||
modified 29 Mar 2012
|
||||
by Tom Igoe
|
||||
modified 3 May 2014
|
||||
by Scott Fitzgerald
|
||||
|
||||
This example is in the public domain
|
||||
|
||||
@ -54,6 +56,18 @@ void loop() {
|
||||
// wait for new window to open:
|
||||
delay(1000);
|
||||
|
||||
// versions of the Arduino IDE after 1.5 pre-populate
|
||||
// new sketches with setup() and loop() functions
|
||||
// let's clear the window before typing anything new
|
||||
// select all
|
||||
Keyboard.press(ctrlKey);
|
||||
Keyboard.press('a');
|
||||
delay(500);
|
||||
Keyboard.releaseAll();
|
||||
// delete the selected text
|
||||
Keyboard.write(KEY_BACKSPACE);
|
||||
delay(500);
|
||||
|
||||
// Type out "blink":
|
||||
Keyboard.println("void setup() {");
|
||||
Keyboard.println("pinMode(13, OUTPUT);");
|
||||
@ -93,3 +107,4 @@ void loop() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user