Skip to content

Instantly share code, notes, and snippets.

@rocketjosh
Created March 10, 2021 18:58
Show Gist options
  • Save rocketjosh/771bc9e57ad905e3b1489fc6ed7e844c to your computer and use it in GitHub Desktop.
Save rocketjosh/771bc9e57ad905e3b1489fc6ed7e844c to your computer and use it in GitHub Desktop.
/*
9141 UART test - ESP32 Dev board
*/
#define RXD2 22
#define TXD2 21
void setup() {
Serial.begin(9600);
Serial1.begin(9600, SERIAL_8N1, RXD2, TXD2);
delay(1000);
Serial.println("Loopback program started");
pinMode(RXD2, INPUT_PULLUP);
}
void loop() {
if(Serial.available()){
Serial1.write(Serial.read());
}
if(Serial1.available()){
Serial.write(Serial1.read());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment