Created
May 12, 2024 00:26
-
-
Save FreeFly19/0f4ac749d88bb72999d16b1e8ae70ccc to your computer and use it in GitHub Desktop.
ESP32 USB to UART proxy
This file contains hidden or 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
void setup() { | |
Serial.begin(230400,SERIAL_8N1); | |
Serial1.begin(230400, SERIAL_8N1, 21, 22); | |
} | |
int n; | |
void loop() { | |
n = Serial1.available(); | |
if (n != 0) | |
{ | |
char y = Serial1.read(); | |
Serial.write(y); | |
} | |
n = Serial.available(); | |
if (n != 0) | |
{ | |
char y = Serial.read(); | |
Serial1.write(y); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment