Created
March 10, 2021 18:58
-
-
Save rocketjosh/771bc9e57ad905e3b1489fc6ed7e844c to your computer and use it in GitHub Desktop.
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
/* | |
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