Created
June 29, 2024 23:39
-
-
Save shah253kt/1d0e1d2071e07e90ef1a7027270e7bae to your computer and use it in GitHub Desktop.
Arduino serial port loopback test
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
#define OtherSerial Serial1 | |
void setup() { | |
Serial.begin(115200); | |
OtherSerial.begin(115200); | |
} | |
void loop() { | |
if (Serial.available()) { | |
OtherSerial.write(Serial.read()); | |
} | |
if (OtherSerial.available()) { | |
Serial.write(OtherSerial.read()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment