Skip to content

Commit 202bb10

Browse files
author
Tom Igoe
committed
Updated all serial in setup examples with a note about the serial check
1 parent a631e4f commit 202bb10

File tree

32 files changed

+91
-28
lines changed

32 files changed

+91
-28
lines changed

build/shared/examples/04.Communication/ASCIITable/ASCIITable.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
void setup() {
2323
//Initialize serial and wait for port to open:
2424
Serial.begin(9600);
25+
// this check is only needed on the Leonardo:
2526
while (!Serial) ;
2627

2728
// prints title with ending line break

build/shared/examples/04.Communication/SerialCallResponseASCII/SerialCallResponseASCII.ino

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ void setup()
3737
{
3838
// start serial port at 9600 bps and wait for port to open:
3939
Serial.begin(9600);
40+
// this check is only needed on the Leonardo:
4041
while (!Serial) ;
42+
;
4143

4244
pinMode(2, INPUT); // digital sensor is on digital pin 2
4345
establishContact(); // send a byte to establish contact until receiver responds

build/shared/examples/08.Strings/CharacterAnalysis/CharacterAnalysis.ino

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
void setup() {
1515
// Open serial communications and wait for port to open:
1616
Serial.begin(9600);
17-
while(!Serial) ;
17+
// this check is only needed on the Leonardo:
18+
while (!Serial) ;
19+
;
1820

1921
// send an intro:
2022
Serial.println("send any byte and I'll tell you everything I can about it");

build/shared/examples/08.Strings/StringAdditionOperator/StringAdditionOperator.ino

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ String stringOne, stringTwo, stringThree;
1919
void setup() {
2020
// initialize serial and wait for port to open:
2121
Serial.begin(9600);
22+
// this check is only needed on the Leonardo:
2223
while (!Serial) ;
24+
;
2325

2426
stringOne = String("stringThree = ");
2527
stringTwo = String("this string");

build/shared/examples/08.Strings/StringAppendOperator/StringAppendOperator.ino

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ String stringOne, stringTwo;
1616
void setup() {
1717
// Open serial communications and wait for port to open:
1818
Serial.begin(9600);
19-
while(!Serial) ;
19+
// this check is only needed on the Leonardo:
20+
while (!Serial) ;
21+
;
2022

2123
stringOne = String("Sensor ");
2224
stringTwo = String("value");

build/shared/examples/08.Strings/StringCaseChanges/StringCaseChanges.ino

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
void setup() {
1616
// Open serial communications and wait for port to open:
1717
Serial.begin(9600);
18-
while(!Serial) ;
18+
// this check is only needed on the Leonardo:
19+
while (!Serial) ;
20+
;
1921

2022
Serial.println("\n\nString case changes:");
2123
}

build/shared/examples/08.Strings/StringCharacters/StringCharacters.ino

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
void setup() {
1616
// Open serial communications and wait for port to open:
1717
Serial.begin(9600);
18-
while(!Serial) ;
18+
// this check is only needed on the Leonardo:
19+
while (!Serial) ;
20+
;
1921

2022
Serial.println("\n\nString charAt() and setCharAt():");
2123
}

build/shared/examples/08.Strings/StringComparisonOperators/StringComparisonOperators.ino

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ String stringOne, stringTwo;
1717
void setup() {
1818
// Open serial communications and wait for port to open:
1919
Serial.begin(9600);
20-
while(!Serial) ;
20+
// this check is only needed on the Leonardo:
21+
while (!Serial) ;
22+
;
2123

2224
stringOne = String("this");
2325
stringTwo = String("that");

build/shared/examples/08.Strings/StringIndexOf/StringIndexOf.ino

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
void setup() {
1616
// Open serial communications and wait for port to open:
1717
Serial.begin(9600);
18-
while(!Serial) ;
18+
// this check is only needed on the Leonardo:
19+
while (!Serial) ;
20+
;
1921

2022
Serial.println("\n\nString indexOf() and lastIndexOf() functions:");
2123

build/shared/examples/08.Strings/StringLengthTrim/StringLengthTrim.ino

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
void setup() {
1616
// Open serial communications and wait for port to open:
1717
Serial.begin(9600);
18-
while(!Serial) ;
18+
// this check is only needed on the Leonardo:
19+
while (!Serial) ;
20+
;
1921

2022
Serial.println("\n\nString length() and trim():");
2123
}

0 commit comments

Comments
 (0)