diff options
author | Fede85 <f.vanzati@gmail.com> | 2013-09-06 15:38:07 +0200 |
---|---|---|
committer | Fede85 <f.vanzati@gmail.com> | 2013-09-06 15:38:07 +0200 |
commit | a3e2e68e2b7edb9f5434734bed4001df1e65451c (patch) | |
tree | d4ef938bd8179a15d41b19197c51ca0a7f93936f /libraries/Bridge/examples/Process/Process.ino | |
parent | 35f10e412f5d00027f9d7f2036243c681dbec406 (diff) |
Bridge library to the 1.5 format
Diffstat (limited to 'libraries/Bridge/examples/Process/Process.ino')
-rw-r--r-- | libraries/Bridge/examples/Process/Process.ino | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/libraries/Bridge/examples/Process/Process.ino b/libraries/Bridge/examples/Process/Process.ino deleted file mode 100644 index 7646d15..0000000 --- a/libraries/Bridge/examples/Process/Process.ino +++ /dev/null @@ -1,70 +0,0 @@ -/* - Running process using Process class. - - This sketch demonstrate how to run linux processes - using an Arduino Yún. - - created 5 Jun 2013 - by Cristian Maglie - - This example code is in the public domain. - - */ - -#include <Process.h> - -void setup() { - // Initialize Bridge - Bridge.begin(); - - // Initialize Serial - Serial.begin(9600); - - // Wait until a Serial Monitor is connected. - while (!Serial); - - // run various example processes - runCurl(); - runCpuInfo(); -} - -void loop() { - // Do nothing here. -} - -void runCurl() { - // Launch "curl" command and get Arduino ascii art logo from the network - // curl is command line program for transferring data using different internet protocols - Process p; // Create a process and call it "p" - p.begin("curl"); // Process that launch the "curl" command - p.addParameter("http://arduino.cc/asciilogo.txt"); // Add the URL parameter to "curl" - p.run(); // Run the process and wait for its termination - - // Print arduino logo over the Serial - // A process output can be read with the stream methods - while (p.available()>0) { - char c = p.read(); - Serial.print(c); - } - // Ensure the last bit of data is sent. - Serial.flush(); -} - -void runCpuInfo() { - // Launch "cat /proc/cpuinfo" command (shows info on Atheros CPU) - // cat is a command line utility that shows the content of a file - Process p; // Create a process and call it "p" - p.begin("cat"); // Process that launch the "cat" command - p.addParameter("/proc/cpuinfo"); // Add the cpuifo file path as parameter to cut - p.run(); // Run the process and wait for its termination - - // Print command output on the Serial. - // A process output can be read with the stream methods - while (p.available()>0) { - char c = p.read(); - Serial.print(c); - } - // Ensure the last bit of data is sent. - Serial.flush(); -} - |