aboutsummaryrefslogtreecommitdiff
path: root/libraries/Bridge/examples/ShellCommands
diff options
context:
space:
mode:
authorFede85 <f.vanzati@gmail.com>2013-07-02 21:23:59 +0200
committerFede85 <f.vanzati@gmail.com>2013-07-02 21:23:59 +0200
commita1f48d22ac570f0ded6db46c0d4eef0c7216a028 (patch)
tree198406ca75298283604d7b5bcb804ba9624da26c /libraries/Bridge/examples/ShellCommands
parent13c664ed488cf1dfdf621d2a9f45e044a1103709 (diff)
modifide comments in Yun examples ShellCommands.ino ConsolePixel.ino
Diffstat (limited to 'libraries/Bridge/examples/ShellCommands')
-rw-r--r--libraries/Bridge/examples/ShellCommands/ShellCommands.ino20
1 files changed, 11 insertions, 9 deletions
diff --git a/libraries/Bridge/examples/ShellCommands/ShellCommands.ino b/libraries/Bridge/examples/ShellCommands/ShellCommands.ino
index d2f9b7a..aabd0ec 100644
--- a/libraries/Bridge/examples/ShellCommands/ShellCommands.ino
+++ b/libraries/Bridge/examples/ShellCommands/ShellCommands.ino
@@ -1,6 +1,6 @@
/*
- Running shell coommands using Process class.
+ Running shell commands using Process class.
This sketch demonstrate how to run linux shell commands
using an Arduino Yún. It runs the wifiCheck script on the linino side
@@ -23,9 +23,11 @@
#include <Process.h>
void setup() {
- // initialize the Bridge and Serial connections:
- Bridge.begin();
- Serial.begin(9600);
+ Bridge.begin(); // Initialize the Bridge
+ Serial.begin(9600); // Initialize the Serial
+
+ // Wait until a Serial Monitor is connected.
+ while(!Serial);
}
void loop() {
@@ -40,12 +42,12 @@ void loop() {
// Read command output. runShellCommand() should have passed "Signal: xx&":
while (p.available()) {
- int result = p.parseInt(); // look for an integer
- int signal = map(result, 0, 100, 0, 255); // map result from 0-100 range to 0-255
- analogWrite(9, signal); // set the brightness of LED on pin 9
- Serial.println(result); // print the number as well
+ int result = p.parseInt(); // look for an integer
+ int signal = map(result, 0, 100, 0, 255); // map result from 0-100 range to 0-255
+ analogWrite(9, signal); // set the brightness of LED on pin 9
+ Serial.println(result); // print the number as well
}
- delay(5000); // wait 5 seconds before you do it again
+ delay(5000); // wait 5 seconds before you do it again
}