1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-03-14 11:29:26 +01:00

Bridge default speed increased to 250k

This commit is contained in:
Cristian Maglie 2013-06-27 15:44:20 +02:00
parent 8830751859
commit 579ff7c7a6
2 changed files with 10 additions and 19 deletions

View File

@ -75,7 +75,7 @@ public:
} }
void begin() { void begin() {
serial.begin(115200); serial.begin(250000);
BridgeClass::begin(); BridgeClass::begin();
} }

View File

@ -14,6 +14,8 @@
'~' followed by '0' -> Set the UART speed to 57600 baud '~' followed by '0' -> Set the UART speed to 57600 baud
'~' 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 '3' -> Set the UART speed to 500000 baud
The circuit: The circuit:
* Arduino Yun * Arduino Yun
@ -25,23 +27,13 @@
This example code is in the public domain. This example code is in the public domain.
*/ */
long lininoBaud = 115200; long lininoBaud = 250000;
// Pin 13 has an LED connected on most Arduino boards.
int led = 13;
int ledState = HIGH; // whether the LED is high or low
void setup() { void setup() {
Serial.begin(115200); // open serial connection via USB-Serial Serial.begin(115200); // open serial connection via USB-Serial
Serial1.begin(lininoBaud); // open serial connection to Linino 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; boolean commandMode = false;
void loop() { void loop() {
@ -61,22 +53,21 @@ void loop() {
} else if (c == '1') { // '1' key pressed? } else if (c == '1') { // '1' key pressed?
Serial1.begin(115200); // set speed to 115200 Serial1.begin(115200); // set speed to 115200
Serial.println("Speed set 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? } 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
} }
commandMode = false; // in all cases exit from command mode 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? if (Serial1.available()) { // got anything from Linino?
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
} }
} }