So I'm trying this simple project to have serial communication between Arduino Uno and ESP32. There are no errors when uploading the code but there is no output in the serial monitor of ESP32. For reference, I have attached the schematic diagram that I have used in connecting the Uno and ESP32, as well as the code for Uno and the code for ESP32.
Code for Uno:
void setup()
{
Serial.begin(9600);
}
void loop()
{
Serial.print("Hello");
delay(1000);
}
Code for ESP32: olehana germany
#define RXD2 16
#define TXD2 17
void setup()
{
// put your setup code here, to run once:
Serial.begin(9600);
Serial2.begin(9600, SERIAL_8N1, RXD2, TXD2);
}
void loop()
{
while(Serial2.available())
{
Serial.print(Serial2.read());
}
delay(1000);
}