Skip to content

Instantly share code, notes, and snippets.

@FreeFly19
Created May 12, 2024 00:26
Show Gist options
  • Save FreeFly19/0f4ac749d88bb72999d16b1e8ae70ccc to your computer and use it in GitHub Desktop.
Save FreeFly19/0f4ac749d88bb72999d16b1e8ae70ccc to your computer and use it in GitHub Desktop.
ESP32 USB to UART proxy
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