Skip to content

Commit d612a6f

Browse files
committed
Changed ShellCommands from Console to Serial
1 parent 0002863 commit d612a6f

File tree

1 file changed

+24
-9
lines changed

1 file changed

+24
-9
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,41 @@
11

2-
/* Demonstrate shell commands */
2+
/*
3+
Running shell coommands using Process class.
4+
5+
This sketch demonstrate how to run linux shell commands
6+
using an Arduino Yún.
7+
8+
The circuit:
9+
* Arduino Yun
10+
11+
created 12 Jun 2013
12+
by Cristian Maglie
13+
modified 21 June 2013
14+
by Tom Igoe
15+
16+
This example code is in the public domain.
17+
18+
*/
319

420
#include <Process.h>
521

622
void setup() {
23+
// initialize the Bridge and Serial connections:
724
Bridge.begin();
8-
Console.begin();
9-
Console.buffer(64);
25+
Serial.begin(9600);
1026
}
1127

1228
void loop() {
1329
Process p;
14-
// This command line prints the name of the wireless that the board is connected to or that the board has created
30+
// This command line prints the name of the wireless network
31+
// that the board is connected to, or the network which the board has created:
1532
p.runShellCommand(F("lua /usr/lib/lua/pretty_wifi_info.lua | grep SSID"));
1633

1734
// Read command output
1835
while (p.available()) {
1936
char c = p.read();
20-
Console.print(c);
21-
}
22-
Console.flush();
23-
24-
delay(5000);
37+
Serial.print(c);
38+
}
39+
while (true); // do nothing more
2540
}
2641

0 commit comments

Comments
 (0)