diff --git a/build/shared/examples/02.Digital/BlinkWithoutDelay/BlinkWithoutDelay.ino b/build/shared/examples/02.Digital/BlinkWithoutDelay/BlinkWithoutDelay.ino index 014357191..56b274efc 100644 --- a/build/shared/examples/02.Digital/BlinkWithoutDelay/BlinkWithoutDelay.ino +++ b/build/shared/examples/02.Digital/BlinkWithoutDelay/BlinkWithoutDelay.ino @@ -9,29 +9,31 @@ * Note: on most Arduinos, there is already an LED on the board that's attached to pin 13, so no hardware is needed for this example. - created 2005 by David A. Mellis modified 8 Feb 2010 by Paul Stoffregen + modified 11 Nov 2013 + by Scott Fitzgerald + This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/BlinkWithoutDelay */ -// constants won't change. Used here to -// set pin numbers: +// constants won't change. Used here to set a pin number : const int ledPin = 13; // the number of the LED pin -// Variables will change: +// Variables will change : int ledState = LOW; // ledState used to set the LED -long previousMillis = 0; // will store last time LED was updated -// the follow variables is a long because the time, measured in miliseconds, -// will quickly become a bigger number than can be stored in an int. -long interval = 1000; // interval at which to blink (milliseconds) +// Generally, you shuould use "unsigned long" for variables that hold time +// The value will quickly become too large for an int to store +unsigned long previousMillis = 0; // will store last time LED was updated + +// constants won't change : +const long interval = 1000; // interval at which to blink (milliseconds) void setup() { // set the digital pin as output: @@ -48,7 +50,7 @@ void loop() // blink the LED. unsigned long currentMillis = millis(); - if(currentMillis - previousMillis > interval) { + if(currentMillis - previousMillis >= interval) { // save the last time you blinked the LED previousMillis = currentMillis; diff --git a/build/shared/examples/09.USB/Keyboard/KeyboardMessage/KeyboardMessage.ino b/build/shared/examples/09.USB/Keyboard/KeyboardMessage/KeyboardMessage.ino index 39222fdaa..1f17668d1 100644 --- a/build/shared/examples/09.USB/Keyboard/KeyboardMessage/KeyboardMessage.ino +++ b/build/shared/examples/09.USB/Keyboard/KeyboardMessage/KeyboardMessage.ino @@ -1,21 +1,23 @@ /* - Keyboard Button test + Keyboard Message test For the Arduino Leonardo and Micro. Sends a text string when a button is pressed. The circuit: - * pushbutton attached from pin 2 to +5V + * pushbutton attached from pin 4 to +5V * 10-kilohm resistor attached from pin 4 to ground created 24 Oct 2011 modified 27 Mar 2012 by Tom Igoe + modified 11 Nov 2013 + by Scott Fitzgerald This example code is in the public domain. - http://www.arduino.cc/en/Tutorial/KeyboardButton + http://www.arduino.cc/en/Tutorial/KeyboardMessage */ const int buttonPin = 4; // input pin for pushbutton diff --git a/libraries/LiquidCrystal/examples/CustomCharacter/CustomCharacter.ino b/libraries/LiquidCrystal/examples/CustomCharacter/CustomCharacter.ino index d3ce47924..f714a3a44 100644 --- a/libraries/LiquidCrystal/examples/CustomCharacter/CustomCharacter.ino +++ b/libraries/LiquidCrystal/examples/CustomCharacter/CustomCharacter.ino @@ -22,8 +22,11 @@ * wiper to LCD VO pin (pin 3) * 10K poterntiometer on pin A0 - created21 Mar 2011 + created 21 Mar 2011 by Tom Igoe + modified 11 Nov 2013 + by Scott Fitzgerald + Based on Adafruit's example at https://github.com/adafruit/SPI_VFD/blob/master/examples/createChar/createChar.pde @@ -96,7 +99,11 @@ byte armsUp[8] = { 0b00100, 0b01010 }; + void setup() { + // initialize LCD and set up the number of columns and rows: + lcd.begin(16, 2); + // create a new character lcd.createChar(0, heart); // create a new character @@ -108,11 +115,9 @@ void setup() { // create a new character lcd.createChar(4, armsUp); - // set up the lcd's number of columns and rows: - lcd.begin(16, 2); // Print a message to the lcd. lcd.print("I "); - lcd.write(0); + lcd.write(byte(0)); // when calling lcd.write() '0' must be cast as a byte lcd.print(" Arduino! "); lcd.write(1); @@ -133,6 +138,3 @@ void loop() { lcd.write(4); delay(delayTime); } - - - diff --git a/libraries/SD/examples/listfiles/listfiles.ino b/libraries/SD/examples/listfiles/listfiles.ino index d403073b6..08ded5057 100644 --- a/libraries/SD/examples/listfiles/listfiles.ino +++ b/libraries/SD/examples/listfiles/listfiles.ino @@ -1,7 +1,9 @@ /* - SD card basic file example + Listfiles - This example shows how to create and destroy an SD card file + This example shows how print out the files in a + directory on a SD card + The circuit: * SD card attached to SPI bus as follows: ** MOSI - pin 11 @@ -29,7 +31,6 @@ void setup() ; // wait for serial port to connect. Needed for Leonardo only } - Serial.print("Initializing SD card..."); // On the Ethernet Shield, CS is pin 4. It's set as an output by default. // 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) { File entry = dir.openNextFile(); if (! entry) { // no more files - //Serial.println("**nomorefiles**"); break; } for (uint8_t i=0; i