mirror of
https://github.com/arduino/Arduino.git
synced 2025-03-13 10:29:35 +01:00
Bridge default speed increased to 250k
This commit is contained in:
parent
8830751859
commit
579ff7c7a6
@ -75,7 +75,7 @@ public:
|
||||
}
|
||||
|
||||
void begin() {
|
||||
serial.begin(115200);
|
||||
serial.begin(250000);
|
||||
BridgeClass::begin();
|
||||
}
|
||||
|
||||
|
@ -14,6 +14,8 @@
|
||||
|
||||
'~' followed by '0' -> Set the UART speed to 57600 baud
|
||||
'~' 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
|
||||
|
||||
The circuit:
|
||||
* Arduino Yun
|
||||
@ -25,23 +27,13 @@
|
||||
This example code is in the public domain.
|
||||
*/
|
||||
|
||||
long lininoBaud = 115200;
|
||||
|
||||
// Pin 13 has an LED connected on most Arduino boards.
|
||||
int led = 13;
|
||||
int ledState = HIGH; // whether the LED is high or low
|
||||
|
||||
long lininoBaud = 250000;
|
||||
|
||||
void setup() {
|
||||
Serial.begin(115200); // open serial connection via USB-Serial
|
||||
Serial1.begin(lininoBaud); // open serial connection to Linino
|
||||
|
||||
// initialize the digital pin as an output.
|
||||
pinMode(led, OUTPUT);
|
||||
digitalWrite(led, ledState); // turn the LED on (HIGH is the voltage level)
|
||||
}
|
||||
|
||||
|
||||
boolean commandMode = false;
|
||||
|
||||
void loop() {
|
||||
@ -61,22 +53,21 @@ void loop() {
|
||||
} else if (c == '1') { // '1' key pressed?
|
||||
Serial1.begin(115200); // set speed to 115200
|
||||
Serial.println("Speed set to 115200");
|
||||
} else if (c == '2') { // '2' key pressed?
|
||||
Serial1.begin(250000); // set speed to 250000
|
||||
Serial.println("Speed set to 250000");
|
||||
} else if (c == '3') { // '3' key pressed?
|
||||
Serial1.begin(500000); // set speed to 500000
|
||||
Serial.println("Speed set to 500000");
|
||||
} else { // any other key pressed?
|
||||
Serial1.write('~'); // write '~' to Linino
|
||||
Serial1.write(c); // write char to Linino
|
||||
}
|
||||
commandMode = false; // in all cases exit from command mode
|
||||
}
|
||||
ledState=!ledState; // invert LED state
|
||||
digitalWrite(led, ledState); // toggle the LED
|
||||
}
|
||||
if (Serial1.available()) { // got anything from Linino?
|
||||
char c = (char)Serial1.read(); // read from Linino
|
||||
Serial.write(c); // write to USB-serial
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user