Skip to content

Commit bd04a9d

Browse files
committed
Merge remote-tracking branch 'arduino/master'
2 parents e304180 + b79ee02 commit bd04a9d

File tree

4 files changed

+30
-24
lines changed

4 files changed

+30
-24
lines changed

build/shared/examples/02.Digital/BlinkWithoutDelay/BlinkWithoutDelay.ino

+12-10
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,31 @@
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.
1111
12-
1312
created 2005
1413
by David A. Mellis
1514
modified 8 Feb 2010
1615
by Paul Stoffregen
16+
modified 11 Nov 2013
17+
by Scott Fitzgerald
18+
1719
1820
This example code is in the public domain.
19-
2021
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:
@@ -48,7 +50,7 @@ void loop()
4850
// blink the LED.
4951
unsigned long currentMillis = millis();
5052

51-
if(currentMillis - previousMillis > interval) {
53+
if(currentMillis - previousMillis >= interval) {
5254
// save the last time you blinked the LED
5355
previousMillis = currentMillis;
5456

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

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
11
/*
2-
Keyboard Button test
2+
Keyboard Message test
33
44
For the Arduino Leonardo and Micro.
55
66
Sends a text string when a button is pressed.
77
88
The circuit:
9-
* pushbutton attached from pin 2 to +5V
9+
* pushbutton attached from pin 4 to +5V
1010
* 10-kilohm resistor attached from pin 4 to ground
1111
1212
created 24 Oct 2011
1313
modified 27 Mar 2012
1414
by Tom Igoe
15+
modified 11 Nov 2013
16+
by Scott Fitzgerald
1517
1618
This example code is in the public domain.
1719
18-
http://www.arduino.cc/en/Tutorial/KeyboardButton
20+
http://www.arduino.cc/en/Tutorial/KeyboardMessage
1921
*/
2022

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

libraries/LiquidCrystal/examples/CustomCharacter/CustomCharacter.ino

+9-7
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,11 @@
2222
* wiper to LCD VO pin (pin 3)
2323
* 10K poterntiometer on pin A0
2424
25-
created21 Mar 2011
25+
created 21 Mar 2011
2626
by Tom Igoe
27+
modified 11 Nov 2013
28+
by Scott Fitzgerald
29+
2730
Based on Adafruit's example at
2831
https://github.com/adafruit/SPI_VFD/blob/master/examples/createChar/createChar.pde
2932
@@ -96,7 +99,11 @@ byte armsUp[8] = {
9699
0b00100,
97100
0b01010
98101
};
102+
99103
void setup() {
104+
// initialize LCD and set up the number of columns and rows:
105+
lcd.begin(16, 2);
106+
100107
// create a new character
101108
lcd.createChar(0, heart);
102109
// create a new character
@@ -108,11 +115,9 @@ void setup() {
108115
// create a new character
109116
lcd.createChar(4, armsUp);
110117

111-
// set up the lcd's number of columns and rows:
112-
lcd.begin(16, 2);
113118
// Print a message to the lcd.
114119
lcd.print("I ");
115-
lcd.write(0);
120+
lcd.write(byte(0)); // when calling lcd.write() '0' must be cast as a byte
116121
lcd.print(" Arduino! ");
117122
lcd.write(1);
118123

@@ -133,6 +138,3 @@ void loop() {
133138
lcd.write(4);
134139
delay(delayTime);
135140
}
136-
137-
138-

libraries/SD/examples/listfiles/listfiles.ino

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
/*
2-
SD card basic file example
2+
Listfiles
33
4-
This example shows how to create and destroy an SD card file
4+
This example shows how print out the files in a
5+
directory on a SD card
6+
57
The circuit:
68
* SD card attached to SPI bus as follows:
79
** MOSI - pin 11
@@ -29,7 +31,6 @@ void setup()
2931
; // wait for serial port to connect. Needed for Leonardo only
3032
}
3133

32-
3334
Serial.print("Initializing SD card...");
3435
// On the Ethernet Shield, CS is pin 4. It's set as an output by default.
3536
// Note that even if it's not used as the CS pin, the hardware SS pin
@@ -61,7 +62,6 @@ void printDirectory(File dir, int numTabs) {
6162
File entry = dir.openNextFile();
6263
if (! entry) {
6364
// no more files
64-
//Serial.println("**nomorefiles**");
6565
break;
6666
}
6767
for (uint8_t i=0; i<numTabs; i++) {

0 commit comments

Comments
 (0)