Skip to content

Instantly share code, notes, and snippets.

@shah253kt
Created June 29, 2024 23:39
Show Gist options
  • Save shah253kt/1d0e1d2071e07e90ef1a7027270e7bae to your computer and use it in GitHub Desktop.
Save shah253kt/1d0e1d2071e07e90ef1a7027270e7bae to your computer and use it in GitHub Desktop.
Arduino serial port loopback test
#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