Skip to content

Commit b18e283

Browse files
committed
Merge branch 'master' into ide-1.5.x
Conflicts: build/shared/examples/02.Digital/BlinkWithoutDelay/BlinkWithoutDelay.ino build/shared/examples/09.USB/Keyboard/KeyboardMessage/KeyboardMessage.ino libraries/LiquidCrystal/examples/CustomCharacter/CustomCharacter.ino libraries/SD/examples/listfiles/listfiles.ino
2 parents 8d699fb + 4c89d56 commit b18e283

File tree

2 files changed

+31
-28
lines changed

2 files changed

+31
-28
lines changed

examples/02.Digital/BlinkWithoutDelay/BlinkWithoutDelay.ino

+18-16
Original file line numberDiff line numberDiff line change
@@ -8,30 +8,32 @@
88
* LED attached from pin 13 to ground.
99
* Note: on most Arduinos, there is already an LED on the board
1010
that's attached to pin 13, so no hardware is needed for this example.
11-
12-
11+
1312
created 2005
1413
by David A. Mellis
1514
modified 8 Feb 2010
1615
by Paul Stoffregen
17-
16+
modified 11 Nov 2013
17+
by Scott Fitzgerald
18+
19+
1820
This example code is in the public domain.
19-
20-
21+
2122
http://www.arduino.cc/en/Tutorial/BlinkWithoutDelay
2223
*/
2324

24-
// constants won't change. Used here to
25-
// set pin numbers:
25+
// constants won't change. Used here to set a pin number :
2626
const int ledPin = 13; // the number of the LED pin
2727

28-
// Variables will change:
28+
// Variables will change :
2929
int ledState = LOW; // ledState used to set the LED
30-
long previousMillis = 0; // will store last time LED was updated
3130

32-
// the follow variables is a long because the time, measured in miliseconds,
33-
// will quickly become a bigger number than can be stored in an int.
34-
long interval = 1000; // interval at which to blink (milliseconds)
31+
// Generally, you shuould use "unsigned long" for variables that hold time
32+
// The value will quickly become too large for an int to store
33+
unsigned long previousMillis = 0; // will store last time LED was updated
34+
35+
// constants won't change :
36+
const long interval = 1000; // interval at which to blink (milliseconds)
3537

3638
void setup() {
3739
// set the digital pin as output:
@@ -47,10 +49,10 @@ void loop()
4749
// the LED is bigger than the interval at which you want to
4850
// blink the LED.
4951
unsigned long currentMillis = millis();
50-
51-
if (currentMillis - previousMillis > interval) {
52-
// save the last time you blinked the LED
53-
previousMillis = currentMillis;
52+
53+
if(currentMillis - previousMillis >= interval) {
54+
// save the last time you blinked the LED
55+
previousMillis = currentMillis;
5456

5557
// if the LED is off turn it on and vice-versa:
5658
if (ledState == LOW)

examples/09.USB/Keyboard/KeyboardMessage/KeyboardMessage.ino

+13-12
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
1-
/*
2-
Keyboard Button test
3-
4-
For the Arduino Leonardo, Micro and Due boards.
5-
1+
/*
2+
Keyboard Message test
3+
4+
For the Arduino Leonardo and Micro.
5+
66
Sends a text string when a button is pressed.
77
88
The circuit:
9-
* pushbutton attached from pin 2 to +5V on AVR boards
10-
and to +3.3V to the Arduino Due
11-
* 10-kilohm resistor attached from pin 2 to ground
12-
9+
* pushbutton attached from pin 4 to +5V
10+
* 10-kilohm resistor attached from pin 4 to ground
11+
1312
created 24 Oct 2011
1413
modified 27 Mar 2012
1514
by Tom Igoe
16-
15+
modified 11 Nov 2013
16+
by Scott Fitzgerald
17+
1718
This example code is in the public domain.
18-
19-
http://www.arduino.cc/en/Tutorial/KeyboardButton
19+
20+
http://www.arduino.cc/en/Tutorial/KeyboardMessage
2021
*/
2122

2223
const int buttonPin = 4; // input pin for pushbutton

0 commit comments

Comments
 (0)