-
-
Save JamesHagerman/0b446ebd23b7d0048f47744502c1f7cd to your computer and use it in GitHub Desktop.
Particle Photon USB to UART passthrough
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
/* 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