aboutsummaryrefslogtreecommitdiff
path: root/libraries/Bridge/examples/YunSerialTerminal/YunSerialTerminal.ino
diff options
context:
space:
mode:
authorCristian Maglie <c.maglie@bug.st>2013-07-10 20:37:31 +0200
committerCristian Maglie <c.maglie@bug.st>2013-07-10 20:37:31 +0200
commit67d03f1ea463ae011100b5c6256fa376fac40220 (patch)
treea515901f816cc8b32de83659a6cab91080976777 /libraries/Bridge/examples/YunSerialTerminal/YunSerialTerminal.ino
parentdec517181e596da42420807a50d61f4208cf4c49 (diff)
Updated YunSerialTerminal: added command to shutdown bridge
Diffstat (limited to 'libraries/Bridge/examples/YunSerialTerminal/YunSerialTerminal.ino')
-rw-r--r--libraries/Bridge/examples/YunSerialTerminal/YunSerialTerminal.ino9
1 files changed, 7 insertions, 2 deletions
diff --git a/libraries/Bridge/examples/YunSerialTerminal/YunSerialTerminal.ino b/libraries/Bridge/examples/YunSerialTerminal/YunSerialTerminal.ino
index 0ae3c2e..faffd93 100644
--- a/libraries/Bridge/examples/YunSerialTerminal/YunSerialTerminal.ino
+++ b/libraries/Bridge/examples/YunSerialTerminal/YunSerialTerminal.ino
@@ -16,7 +16,9 @@
'~' followed by '1' -> Set the UART speed to 115200 baud
'~' followed by '2' -> Set the UART speed to 250000 baud
'~' followed by '3' -> Set the UART speed to 500000 baud
-
+ '~' followeb by '~' -> Sends the bridge's shutdown command to
+ obtain the console.
+
The circuit:
* Arduino Yun
@@ -59,6 +61,9 @@ void loop() {
} else if (c == '3') { // '3' key pressed?
Serial1.begin(500000); // set speed to 500000
Serial.println("Speed set to 500000");
+ } else if (c == '~') {
+ Serial1.write((uint8_t *)"\xff\0\0\x05XXXXX\x0d\xaf", 11);
+ Serial.println("Sending bridge's shutdown command");
} else { // any other key pressed?
Serial1.write('~'); // write '~' to Linino
Serial1.write(c); // write char to Linino
@@ -70,4 +75,4 @@ void loop() {
char c = (char)Serial1.read(); // read from Linino
Serial.write(c); // write to USB-serial
}
-}
+} \ No newline at end of file