two arduino serial communication

Hi guys. I'm not familiar using english so I'm sorry it may hard to understand.

First, I have 2 arduino board (Yun, Uno) and I want to send and receive some data between these board.

To test simple things, I tried the code below.

Yun side.

void setup() {
  Serial.begin(9600);
  pinMode(13, OUTPUT);
}

void loop() {
  
  delay(3000);
  Serial.write('0');
  digitalWrite(13, LOW);
  delay(3000);
  Serial.write('1');
  digitalWrite(13, HIGH);

}

and uno side.

void setup(){
  Serial.begin(9600);
  pinMode(13, OUTPUT);
}

void loop(){
  char temp;
  if(Serial.available()){
    temp = Serial.read();
    if(temp == '0'){
      
      digitalWrite(13, LOW);}
    if(temp == '1'){
      
      digitalWrite(13, HIGH);}
  }
  
}

It's very easy to understand and I though it will work.

in the yun side, when i connect wiht pc, it works well (led and tx blink).

but when i connect it with uno, only led blinks.

I connected rx, tx crossed and uno's 5V to yun's vin and gnd to gnd.

I wonder why yun doesn't send any serial data.

I searched a lot of time but i couldn't find it. help me plz

The Yun is a 5V device; I'm not familiar with it but if it's anything like other 5V arduinos, Vin should be above 5V (at least 6V, preferably 7V or higher) . You can try to feed it on the 5V pin instead of the Vin pin.

No guarantees and I don't take resposibility if you blow it up :wink: There is a dedicated Yun section where you might be able to get an answer how to power the Yun with a 5V power supply.

It's also possible that the 5V output of the Uno can't deliver enough power (current) to keep the Yun happy.

The TX and RX LEDs are driven by the USB to Serial converter chip, NOT by the AtMega328 chip. If you have the hardware serial pins connected directly, you are not using the USB to Serial converter, so any expectation that that chip will cause the TX or RX LEDs to flash is completely unreasonable.

The Arduino side of a Yun is essentially the same as a Leonardo. Serial communicates with the PC through the USB cable and does not use Pins 0 and 1. Those pins are used by Serial1.

...R

Oh... Robin....

love you so much. God bless you.