Hi everyone I’m testing my uart pins: if i connect the UART0 tx to the UART1 Rx and run this code
#define RXp1 4
#define TXp1 5
void setup() {
// put your setup code here, to run once:
Serial1.begin(115200, SERIAL_8N1, RXp1, TXp1);
Serial.begin(115200);
Serial.println("Mesaj Gönderildi");
// Serial2.begin(115200, SERIAL_8N1, RXp2, TXp2);
}
void loop() {
static String deneme;
static bool one_shot=0;
if(Serial1.available() && one_shot==0)
{
delay(1);
deneme = Serial1.readString();
one_shot=1;
Serial.println("ilk defa girildi");
}
//Serial.println("Message Received: ");
// Serial.println(Serial1.readString());
// Serial.begin(115200,SERIAL_8N1, RXp1, TXp1);
Serial.println(deneme);
delay(100);
}
it works as i expected but if i connect the UART1 Tx to the UART0 Rx and run this code:
#define RXp1 4
#define TXp1 5
void setup() {
// put your setup code here, to run once:
Serial1.begin(115200, SERIAL_8N1, RXp1, TXp1);
Serial.begin(115200);
Serial1.println("Mesaj Gönderildi");
// Serial2.begin(115200, SERIAL_8N1, RXp2, TXp2);
}
void loop() {
static String deneme;
static bool one_shot=0;
delay(10);
if(Serial.available() && one_shot==0)
{
delay(1);
deneme = Serial.readString();
one_shot=1;
Serial1.println("ilk defa girildi");
}
//Serial.println("Message Received: ");
// Serial.println(Serial1.readString());
// Serial.begin(115200,SERIAL_8N1, RXp1, TXp1);
Serial.println(deneme);
delay(100);
}
I cant get any output.