Hi, I am trying to use RXD, TXD port inside my WT32-ETH01 to read RS232-TTL input,
What is the way to do it?
I have plugged my RS232-TTL to RXD(5) and TXD(17)
what is the correct way to access it:
#define RXD2 5
#define TXD2 17
void setup() {
// Note the format for setting a serial port is as follows: Serial2.begin(baud-rate, protocol, RX pin, TX pin);
Serial.begin(115200);
Serial1.begin(9600, SERIAL_8N1, RXD2, TXD2); // or should I use Serial1.begin(9600)
Serial2.begin(9600, SERIAL_8N1, RXD2, TXD2); // or should I use Serial2.begin(9600)
}
void loop() {
Serial.print(char(Serial2.read()));
delay(1000);
}
Thanks!