Last active
January 28, 2021 17:41
-
-
Save bmatusiak/e7adebfe2f65ca6475e2cbcd51ec9e74 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| uint32_t baud; | |
| uint32_t old_baud; | |
| void loop() { | |
| // put your main code here, to run repeatedly: | |
| baud = Serial.baud(); | |
| if (baud != old_baud) { | |
| SerialTTL.begin(baud); | |
| while (!SerialTTL); | |
| old_baud = baud; | |
| } | |
| if (Serial.available() > 0) | |
| { | |
| char c = Serial.read(); | |
| SerialTTL.write(c); | |
| } | |
| if (SerialTTL.available() > 0) { | |
| char c = SerialTTL.read(); | |
| Serial.write(c); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment