I have ESP32 module,
UART0,UART2 is working both uart transmit and reception.
but uart 1 receive not working(uart1 transmit work).
code is given below .why this happens?
In setup() ,string "started" is come.
#include <HardwareSerial.h>
void setup() {
Serial.begin(115200);
Serial2.begin(115200, SERIAL_8N1, 16,17);
Serial1.begin(115200, SERIAL_8N1,9,10);
Serial1.println("started");
}
void loop() {
while(Serial.available() > 0)
{
char byteFromSerial2 = Serial.read();
Serial.print(byteFromSerial2);
}
while (Serial2.available() > 0) {
char byteFromSerial = Serial2.read();
Serial2.println(byteFromSerial);
}
while (Serial1.available() > 0) {
char byteFromSerial1 = Serial1.read();
Serial1.print(byteFromSerial1);
}
}