Skip to content

Instantly share code, notes, and snippets.

@JamesHagerman
Forked from monkbroc/usb_to_uart.ino
Created September 21, 2018 17:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JamesHagerman/0b446ebd23b7d0048f47744502c1f7cd to your computer and use it in GitHub Desktop.
Save JamesHagerman/0b446ebd23b7d0048f47744502c1f7cd 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