Last active
August 29, 2015 14:07
-
-
Save volca/adf8df85b0cc94a3d39a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String tmp; | |
void setup() { | |
Serial.begin(115200); | |
Serial1.begin(115200); | |
while (!Serial) { | |
; // wait for serial port to connect. Needed for Leonardo only | |
} | |
Serial.println("hello!"); | |
}; | |
void loop() { | |
while (Serial1.available() > 0) { | |
tmp += char(Serial1.read()); | |
delay(2); | |
} | |
if(tmp.length() > 0) { | |
Serial.println(tmp); | |
tmp = ""; | |
} | |
if (Serial.available()) { | |
Serial1.write(Serial.read()); | |
} | |
delayMicroseconds(10); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment