Skip to content

Instantly share code, notes, and snippets.

@monkbroc
Last active September 21, 2018 17:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save monkbroc/88ca591063e2420a3fb761769c87931f to your computer and use it in GitHub Desktop.
Save monkbroc/88ca591063e2420a3fb761769c87931f to your computer and use it in GitHub Desktop.
Particle Photon USB to UART passthrough
/* Pass through all data from USB serial to UART serial (TX/RX pins)
*/
SYSTEM_THREAD(ENABLED);
SYSTEM_MODE(MANUAL);
void setup() {
Serial1.begin(9600);
Serial.begin();
}
void loop() {
while (Serial1.available()) {
Serial.write(Serial1.read());
}
while (Serial.available()) {
Serial1.write(Serial.read());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment