Skip to content

Commit

Permalink
Updated all comments for while (!Serial) additions to serial-based ex…
Browse files Browse the repository at this point in the history
…amples
  • Loading branch information
Tom Igoe committed Apr 9, 2012
1 parent 1d0a5bf commit 6f93d3f
Show file tree
Hide file tree
Showing 21 changed files with 102 additions and 81 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
created 2006
by Nicholas Zambetti
modified 2 Apr 2012
modified 9 Apr 2012
by Tom Igoe
This example code is in the public domain.
Expand All @@ -22,8 +22,9 @@
void setup() {
//Initialize serial and wait for port to open:
Serial.begin(9600);
// this check is only needed on the Leonardo:
while (!Serial) ;
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}

// prints title with ending line break
Serial.println("ASCII Table ~ Character Map");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
Created 26 Sept. 2005
by Tom Igoe
modified 2 Apr 2012
modified 9 Apr 2012
by Tom Igoe and Scott Fitzgerald
This example code is in the public domain.
Expand All @@ -37,9 +37,10 @@ void setup()
{
// start serial port at 9600 bps and wait for port to open:
Serial.begin(9600);
// this check is only needed on the Leonardo:
while (!Serial) ;
;
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}


pinMode(2, INPUT); // digital sensor is on digital pin 2
establishContact(); // send a byte to establish contact until receiver responds
Expand Down
9 changes: 5 additions & 4 deletions libraries/Ethernet/examples/ChatServer/ChatServer.ino
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
created 18 Dec 2009
by David A. Mellis
modified 2 Apr 2012
modified 9 Apr 2012
by Tom Igoe
*/
Expand Down Expand Up @@ -41,9 +41,10 @@ void setup() {
server.begin();
// Open serial communications and wait for port to open:
Serial.begin(9600);
// this check is only needed on the Leonardo:
while (!Serial) ;
;
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}


Serial.print("Chat server address:");
Serial.println(Ethernet.localIP());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* Ethernet shield attached to pins 10, 11, 12, 13
created 12 April 2011
modified 2 Apr 2012
modified 9 Apr 2012
by Tom Igoe
*/
Expand All @@ -31,8 +31,9 @@ void setup() {
// Open serial communications and wait for port to open:
Serial.begin(9600);
// this check is only needed on the Leonardo:
while (!Serial) ;
;
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}

// start the Ethernet connection:
if (Ethernet.begin(mac) == 0) {
Expand Down
8 changes: 5 additions & 3 deletions libraries/Ethernet/examples/DhcpChatServer/DhcpChatServer.ino
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* Ethernet shield attached to pins 10, 11, 12, 13
created 21 May 2011
modified 2 Apr 2012
modified 9 Apr 2012
by Tom Igoe
Based on ChatServer example by David A. Mellis
Expand All @@ -38,8 +38,10 @@ void setup() {
// Open serial communications and wait for port to open:
Serial.begin(9600);
// this check is only needed on the Leonardo:
while (!Serial) ;
;
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}


// start the Ethernet connection:
Serial.println("Trying to get an IP address using DHCP");
Expand Down
9 changes: 5 additions & 4 deletions libraries/Ethernet/examples/DnsWebClient/DnsWebClient.ino
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
created 18 Dec 2009
by David A. Mellis
modified 2 Apr 2012
modified 9 Apr 2012
by Tom Igoe, based on work by Adrian McEwen
*/
Expand All @@ -30,9 +30,10 @@ EthernetClient client;
void setup() {
// Open serial communications and wait for port to open:
Serial.begin(9600);
// this check is only needed on the Leonardo:
while (!Serial) ;
;
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}


// start the Ethernet connection:
if (Ethernet.begin(mac) == 0) {
Expand Down
9 changes: 5 additions & 4 deletions libraries/Ethernet/examples/PachubeClient/PachubeClient.ino
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* Ethernet shield attached to pins 10, 11, 12, 13
created 15 March 2010
modified 2 Apr 2012
modified 9 Apr 2012
by Tom Igoe with input from Usman Haque and Joe Saavedra
http://arduino.cc/en/Tutorial/PachubeClient
Expand Down Expand Up @@ -55,9 +55,10 @@ const unsigned long postingInterval = 10*1000; //delay between updates to Pachub
void setup() {
// Open serial communications and wait for port to open:
Serial.begin(9600);
// this check is only needed on the Leonardo:
while (!Serial) ;
;
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}


// start the Ethernet connection:
if (Ethernet.begin(mac) == 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* Ethernet shield attached to pins 10, 11, 12, 13
created 15 March 2010
modified 2 Apr 2012
modified 9 Apr 2012
by Tom Igoe with input from Usman Haque and Joe Saavedra
http://arduino.cc/en/Tutorial/PachubeClientString
Expand Down Expand Up @@ -57,9 +57,10 @@ const unsigned long postingInterval = 10*1000; //delay between updates to Pachu
void setup() {
// Open serial communications and wait for port to open:
Serial.begin(9600);
// this check is only needed on the Leonardo:
while (!Serial) ;
;
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}


// give the ethernet module time to boot up:
delay(1000);
Expand Down
9 changes: 5 additions & 4 deletions libraries/Ethernet/examples/TelnetClient/TelnetClient.ino
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* Ethernet shield attached to pins 10, 11, 12, 13
created 14 Sep 2010
modified 2 Apr 2012
modified 9 Apr 2012
by Tom Igoe
*/
Expand Down Expand Up @@ -41,9 +41,10 @@ void setup() {
Ethernet.begin(mac, ip);
// Open serial communications and wait for port to open:
Serial.begin(9600);
// this check is only needed on the Leonardo:
while (!Serial) ;
;
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}


// give the Ethernet shield a second to initialize:
delay(1000);
Expand Down
9 changes: 5 additions & 4 deletions libraries/Ethernet/examples/TwitterClient/TwitterClient.ino
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* Ethernet shield attached to pins 10, 11, 12, 13
created 21 May 2011
modified 2 Apr 2012
modified 9 Apr 2012
by Tom Igoe
This code is in the public domain.
Expand Down Expand Up @@ -54,9 +54,10 @@ void setup() {

// Open serial communications and wait for port to open:
Serial.begin(9600);
// this check is only needed on the Leonardo:
while (!Serial) ;
;
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}


// attempt a DHCP connection:
Serial.println("Attempting to get an IP address using DHCP:");
Expand Down
9 changes: 5 additions & 4 deletions libraries/Ethernet/examples/UdpNtpClient/UdpNtpClient.ino
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
created 4 Sep 2010
by Michael Margolis
modified 2 Apr 2012
modified 9 Apr 2012
by Tom Igoe
This code is in the public domain.
Expand Down Expand Up @@ -40,9 +40,10 @@ void setup()
{
// Open serial communications and wait for port to open:
Serial.begin(9600);
// this check is only needed on the Leonardo:
while (!Serial) ;
;
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}


// start Ethernet and UDP
if (Ethernet.begin(mac) == 0) {
Expand Down
8 changes: 4 additions & 4 deletions libraries/Ethernet/examples/WebClient/WebClient.ino
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Ethernet shield attached to pins 10, 11, 12, 13
created 18 Dec 2009
modified 2 Apr 2012
modified 9 Apr 2012
by David A. Mellis
*/
Expand All @@ -29,9 +29,9 @@ EthernetClient client;
void setup() {
// Open serial communications and wait for port to open:
Serial.begin(9600);
// this check is only needed on the Leonardo:
while (!Serial) ;
;
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}

// start the Ethernet connection:
if (Ethernet.begin(mac) == 0) {
Expand Down
9 changes: 5 additions & 4 deletions libraries/Ethernet/examples/WebServer/WebServer.ino
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
created 18 Dec 2009
by David A. Mellis
modified 2 Apr 2012
modified 9 Apr 2012
by Tom Igoe
*/
Expand All @@ -32,9 +32,10 @@ EthernetServer server(80);
void setup() {
// Open serial communications and wait for port to open:
Serial.begin(9600);
// this check is only needed on the Leonardo:
while (!Serial) ;
;
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}


// start the Ethernet connection and the server:
Ethernet.begin(mac, ip);
Expand Down
9 changes: 5 additions & 4 deletions libraries/SD/examples/CardInfo/CardInfo.ino
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
created 28 Mar 2011
by Limor Fried
modified 2 Apr 2012
modified 9 Apr 2012
by Tom Igoe
*/
// include the SD library:
Expand All @@ -37,9 +37,10 @@ void setup()
{
// Open serial communications and wait for port to open:
Serial.begin(9600);
// this check is only needed on the Leonardo:
while (!Serial) ;
;
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}


Serial.print("\nInitializing SD card...");
// On the Ethernet Shield, CS is pin 4. It's set as an output by default.
Expand Down
9 changes: 5 additions & 4 deletions libraries/SD/examples/Datalogger/Datalogger.ino
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
** CS - pin 4
created 24 Nov 2010
modified 2 Apr 2012
modified 9 Apr 2012
by Tom Igoe
This example code is in the public domain.
Expand All @@ -32,9 +32,10 @@ void setup()
{
// Open serial communications and wait for port to open:
Serial.begin(9600);
// this check is only needed on the Leonardo:
while (!Serial) ;
;
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}


Serial.print("Initializing SD card...");
// make sure that the default chip select pin is set to
Expand Down
9 changes: 5 additions & 4 deletions libraries/SD/examples/DumpFile/DumpFile.ino
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
created 22 December 2010
by Limor Fried
modified 2 Apr 2012
modified 9 Apr 2012
by Tom Igoe
This example code is in the public domain.
Expand All @@ -32,9 +32,10 @@ void setup()
{
// Open serial communications and wait for port to open:
Serial.begin(9600);
// this check is only needed on the Leonardo:
while (!Serial) ;
;
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}


Serial.print("Initializing SD card...");
// make sure that the default chip select pin is set to
Expand Down
9 changes: 5 additions & 4 deletions libraries/SD/examples/Files/Files.ino
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
created Nov 2010
by David A. Mellis
modified 2 Apr 2012
modified 9 Apr 2012
by Tom Igoe
This example code is in the public domain.
Expand All @@ -25,9 +25,10 @@ void setup()
{
// Open serial communications and wait for port to open:
Serial.begin(9600);
// this check is only needed on the Leonardo:
while (!Serial) ;
;
while (!Serial) {
; // 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.
Expand Down
Loading

0 comments on commit 6f93d3f

Please sign in to comment.