From 4d6234529f4d32088a361ae73674b52515a3abfe Mon Sep 17 00:00:00 2001 From: Tom Igoe Date: Sat, 22 Jun 2013 02:03:35 -0400 Subject: Changed ShellCommands from Console to Serial --- .../examples/ShellCommands/ShellCommands.ino | 33 ++++++++++++++++------ 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/libraries/Bridge/examples/ShellCommands/ShellCommands.ino b/libraries/Bridge/examples/ShellCommands/ShellCommands.ino index 4fd7384..47579f8 100644 --- a/libraries/Bridge/examples/ShellCommands/ShellCommands.ino +++ b/libraries/Bridge/examples/ShellCommands/ShellCommands.ino @@ -1,26 +1,41 @@ -/* Demonstrate shell commands */ +/* + Running shell coommands using Process class. + + This sketch demonstrate how to run linux shell commands + using an Arduino Yún. + + The circuit: + * Arduino Yun + + created 12 Jun 2013 + by Cristian Maglie + modified 21 June 2013 + by Tom Igoe + + This example code is in the public domain. + + */ #include void setup() { + // initialize the Bridge and Serial connections: Bridge.begin(); - Console.begin(); - Console.buffer(64); + Serial.begin(9600); } void loop() { Process p; - // This command line prints the name of the wireless that the board is connected to or that the board has created + // This command line prints the name of the wireless network + // that the board is connected to, or the network which the board has created: p.runShellCommand(F("lua /usr/lib/lua/pretty_wifi_info.lua | grep SSID")); // Read command output while (p.available()) { char c = p.read(); - Console.print(c); - } - Console.flush(); - - delay(5000); + Serial.print(c); + } + while (true); // do nothing more } -- cgit v1.2.3-18-g5258