Skip to content

Commit 1a549e7

Browse files
Improve examples (#87)
1 parent c45b667 commit 1a549e7

3 files changed

Lines changed: 8 additions & 16 deletions

File tree

README.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,8 @@ void setup() {
125125
// Connect to the radio stream
126126
stream.connectToHost("http://icecast.omroep.nl/radio6-bb-mp3");
127127

128-
if (!stream.isRunning()) {
129-
Serial.println("Stream not running - system halted");
130-
while (1) delay(100);
131-
}
128+
if (!stream.isRunning())
129+
Serial.println("Stream not running");
132130
}
133131

134132
void loop() {
@@ -227,10 +225,8 @@ void setup() {
227225
// Start playback from an SD file
228226
stream.connectToFile(SD, "/test.mp3");
229227
230-
if (!stream.isRunning()) {
231-
Serial.println("No file running - system halted");
232-
while (1) delay(100);
233-
}
228+
if (!stream.isRunning())
229+
Serial.println("No file running");
234230
}
235231
236232
void loop() {

examples/play-file/play-file.ino

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,8 @@ void setup() {
8585
// Start playback from an SD file
8686
stream.connectToFile(SD, "/test.mp3");
8787

88-
if (!stream.isRunning()) {
89-
Serial.println("No file running - system halted");
90-
while (1) delay(100);
91-
}
88+
if (!stream.isRunning())
89+
Serial.println("No file running");
9290
}
9391

9492
void loop() {

examples/play-stream/play-stream.ino

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,8 @@ void setup() {
9191
// Connect to the radio stream
9292
stream.connectToHost("http://icecast.omroep.nl/radio6-bb-mp3");
9393

94-
if (!stream.isRunning()) {
95-
Serial.println("Stream not running - system halted");
96-
while (1) delay(100);
97-
}
94+
if (!stream.isRunning())
95+
Serial.println("Stream not running");
9896
}
9997

10098
void loop() {

0 commit comments

Comments
 (0)