Skip to content

Commit f362cf1

Browse files
tigoeTom Igoe
authored andcommitted
Updated all serial in setup examples with a note about the serial check
1 parent ed3f3b0 commit f362cf1

File tree

11 files changed

+33
-11
lines changed

11 files changed

+33
-11
lines changed

examples/ChatServer/ChatServer.ino

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ void setup() {
4141
server.begin();
4242
// Open serial communications and wait for port to open:
4343
Serial.begin(9600);
44-
while(!Serial) ;
44+
// this check is only needed on the Leonardo:
45+
while (!Serial) ;
46+
;
4547

4648
Serial.print("Chat server address:");
4749
Serial.println(Ethernet.localIP());

examples/DhcpAddressPrinter/DhcpAddressPrinter.ino

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ EthernetClient client;
3030
void setup() {
3131
// Open serial communications and wait for port to open:
3232
Serial.begin(9600);
33-
while(!Serial) ;
33+
// this check is only needed on the Leonardo:
34+
while (!Serial) ;
35+
;
3436

3537
// start the Ethernet connection:
3638
if (Ethernet.begin(mac) == 0) {

examples/DhcpChatServer/DhcpChatServer.ino

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ boolean gotAMessage = false; // whether or not you got a message from the client
3737
void setup() {
3838
// Open serial communications and wait for port to open:
3939
Serial.begin(9600);
40-
while(!Serial) ;
40+
// this check is only needed on the Leonardo:
41+
while (!Serial) ;
42+
;
4143

4244
// start the Ethernet connection:
4345
Serial.println("Trying to get an IP address using DHCP");

examples/DnsWebClient/DnsWebClient.ino

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ EthernetClient client;
3030
void setup() {
3131
// Open serial communications and wait for port to open:
3232
Serial.begin(9600);
33-
while(!Serial) ;
33+
// this check is only needed on the Leonardo:
34+
while (!Serial) ;
35+
;
3436

3537
// start the Ethernet connection:
3638
if (Ethernet.begin(mac) == 0) {

examples/PachubeClient/PachubeClient.ino

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ const unsigned long postingInterval = 10*1000; //delay between updates to Pachub
5555
void setup() {
5656
// Open serial communications and wait for port to open:
5757
Serial.begin(9600);
58-
while(!Serial) ;
58+
// this check is only needed on the Leonardo:
59+
while (!Serial) ;
60+
;
5961

6062
// start the Ethernet connection:
6163
if (Ethernet.begin(mac) == 0) {

examples/PachubeClientString/PachubeClientString.ino

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ const unsigned long postingInterval = 10*1000; //delay between updates to Pachu
5757
void setup() {
5858
// Open serial communications and wait for port to open:
5959
Serial.begin(9600);
60-
while(!Serial) ;
60+
// this check is only needed on the Leonardo:
61+
while (!Serial) ;
62+
;
6163

6264
// give the ethernet module time to boot up:
6365
delay(1000);

examples/TelnetClient/TelnetClient.ino

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ void setup() {
4141
Ethernet.begin(mac, ip);
4242
// Open serial communications and wait for port to open:
4343
Serial.begin(9600);
44-
while(!Serial) ;
44+
// this check is only needed on the Leonardo:
45+
while (!Serial) ;
46+
;
4547

4648
// give the Ethernet shield a second to initialize:
4749
delay(1000);

examples/TwitterClient/TwitterClient.ino

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ void setup() {
5454

5555
// Open serial communications and wait for port to open:
5656
Serial.begin(9600);
57-
while(!Serial) ;
57+
// this check is only needed on the Leonardo:
58+
while (!Serial) ;
59+
;
5860

5961
// attempt a DHCP connection:
6062
Serial.println("Attempting to get an IP address using DHCP:");

examples/UdpNtpClient/UdpNtpClient.ino

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ void setup()
4040
{
4141
// Open serial communications and wait for port to open:
4242
Serial.begin(9600);
43-
while(!Serial) ;
43+
// this check is only needed on the Leonardo:
44+
while (!Serial) ;
45+
;
4446

4547
// start Ethernet and UDP
4648
if (Ethernet.begin(mac) == 0) {

examples/WebClient/WebClient.ino

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ EthernetClient client;
2929
void setup() {
3030
// Open serial communications and wait for port to open:
3131
Serial.begin(9600);
32-
while(!Serial) ;
32+
// this check is only needed on the Leonardo:
33+
while (!Serial) ;
34+
;
3335

3436
// start the Ethernet connection:
3537
if (Ethernet.begin(mac) == 0) {

0 commit comments

Comments
 (0)