mirror of
https://github.com/arduino/Arduino.git
synced 2025-02-21 15:54:39 +01:00
Updated YunSerialTerminal: added command to shutdown bridge
This commit is contained in:
parent
567af70a44
commit
08e99376ec
@ -16,7 +16,9 @@
|
|||||||
'~' followed by '1' -> Set the UART speed to 115200 baud
|
'~' followed by '1' -> Set the UART speed to 115200 baud
|
||||||
'~' followed by '2' -> Set the UART speed to 250000 baud
|
'~' followed by '2' -> Set the UART speed to 250000 baud
|
||||||
'~' followed by '3' -> Set the UART speed to 500000 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:
|
The circuit:
|
||||||
* Arduino Yun
|
* Arduino Yun
|
||||||
|
|
||||||
@ -59,6 +61,9 @@ void loop() {
|
|||||||
} else if (c == '3') { // '3' key pressed?
|
} else if (c == '3') { // '3' key pressed?
|
||||||
Serial1.begin(500000); // set speed to 500000
|
Serial1.begin(500000); // set speed to 500000
|
||||||
Serial.println("Speed set 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?
|
} else { // any other key pressed?
|
||||||
Serial1.write('~'); // write '~' to Linino
|
Serial1.write('~'); // write '~' to Linino
|
||||||
Serial1.write(c); // write char to Linino
|
Serial1.write(c); // write char to Linino
|
||||||
@ -70,4 +75,4 @@ void loop() {
|
|||||||
char c = (char)Serial1.read(); // read from Linino
|
char c = (char)Serial1.read(); // read from Linino
|
||||||
Serial.write(c); // write to USB-serial
|
Serial.write(c); // write to USB-serial
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user