Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit c0b7c1f

Browse files
committed
Merge remote-tracking branch 'arduino/master' into ide-1.5.x
Conflicts: build/shared/examples/01.Basics/Blink/Blink.ino build/shared/examples/09.USB/Keyboard/KeyboardReprogram/KeyboardReprogram.ino build/shared/examples/10.StarterKit/p02_SpaceshipInterface/p02_SpaceshipInterface.ino hardware/arduino/cores/arduino/HardwareSerial.cpp
2 parents c1371a2 + 1d68dd5 commit c0b7c1f

File tree

3 files changed

+35
-15
lines changed

3 files changed

+35
-15
lines changed

‎examples/01.Basics/Blink/Blink.ino‎

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,28 @@
22
Blink
33
Turns on an LED on for one second, then off for one second, repeatedly.
44
5+
Most Arduinos have an on-board LED you can control. On the Uno and
6+
Leonardo, it is attached to digital pin 13. If you're unsure what
7+
pin the on-board LED is connected to on your Arduino model, check
8+
the documentation at http://arduino.cc
9+
510
This example code is in the public domain.
11+
12+
modified 8 May 2014
13+
by Scott Fitzgerald
614
*/
715

8-
// Pin 13 has an LED connected on most Arduino boards.
9-
// give it a name:
10-
int led = 13;
1116

12-
// the setup routine runs once when you press reset:
17+
// the setup function runs once when you press reset or power the board
1318
void setup() {
14-
// initialize the digital pin as an output.
15-
pinMode(led, OUTPUT);
19+
// initialize digital pin 13 as an output.
20+
pinMode(13, OUTPUT);
1621
}
1722

18-
// the loop routine runs over and over again forever:
23+
// the loop function runs over and over again forever
1924
void loop() {
20-
digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
21-
delay(1000); // wait for a second
22-
digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
23-
delay(1000); // wait for a second
25+
digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level)
26+
delay(1000); // wait for a second
27+
digitalWrite(13, LOW); // turn the LED off by making the voltage LOW
28+
delay(1000); // wait for a second
2429
}

‎examples/09.USB/Keyboard/KeyboardReprogram/KeyboardReprogram.ino‎

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@
1313
a final key combination (CTRL-U).
1414
1515
Circuit:
16-
* Arduino Leonardo, Microor Due
16+
* Arduino Leonardo, Micro, Due, LilyPad USB, or Yun
1717
* wire to connect D2 to ground.
1818
1919
created 5 Mar 2012
2020
modified 29 Mar 2012
2121
by Tom Igoe
22-
22+
modified 3 May 2014
23+
by Scott Fitzgerald
24+
2325
This example is in the public domain
2426
2527
http://www.arduino.cc/en/Tutorial/KeyboardReprogram
@@ -56,6 +58,18 @@ void loop() {
5658
// wait for new window to open:
5759
delay(1000);
5860

61+
// versions of the Arduino IDE after 1.5 pre-populate
62+
// new sketches with setup() and loop() functions
63+
// let's clear the window before typing anything new
64+
// select all
65+
Keyboard.press(ctrlKey);
66+
Keyboard.press('a');
67+
delay(500);
68+
Keyboard.releaseAll();
69+
// delete the selected text
70+
Keyboard.write(KEY_BACKSPACE);
71+
delay(500);
72+
5973
// Type out "blink":
6074
Keyboard.println("void setup() {");
6175
Keyboard.println("pinMode(13, OUTPUT);");
@@ -95,3 +109,4 @@ void loop() {
95109

96110

97111

112+

‎examples/10.StarterKit/p02_SpaceshipInterface/p02_SpaceshipInterface.ino‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@ void loop() {
4444
switchstate = digitalRead(2);
4545

4646
// if the button is not pressed
47-
// blink the red LEDs
47+
// turn on the green LED and off the red LEDs
4848
if (switchstate == LOW) {
4949
digitalWrite(3, HIGH); // turn the green LED on pin 3 on
5050
digitalWrite(4, LOW); // turn the red LED on pin 4 off
5151
digitalWrite(5, LOW); // turn the red LED on pin 5 off
5252
}
5353
// this else is part of the above if() statement.
5454
// if the switch is not LOW (the button is pressed)
55-
// the code below will run
55+
// turn off the green LED and blink alternatively the red LEDs
5656
else {
5757
digitalWrite(3, LOW); // turn the green LED on pin 3 off
5858
digitalWrite(4, LOW); // turn the red LED on pin 4 off

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /