Skip to content

Commit c075aab

Browse files
committed
modified StringSubstring example to add gating on port readiness
1 parent 17fc306 commit c075aab

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

‎examples/08.Strings/StringSubstring/StringSubstring.ino

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
Examples of how to use substring in a String
55
6-
created 27 July 2010
6+
created 27 July 2010, modified 1 April 2012
77
by Tom Igoe
88
99
http://arduino.cc/en/Tutorial/StringSubstring
@@ -13,6 +13,9 @@
1313

1414
void setup() {
1515
Serial.begin(9600);
16+
// Wait for port to be opened:
17+
while (!Serial)
18+
;
1619
Serial.println("\n\nString substring():");
1720
}
1821

0 commit comments

Comments
 (0)