Using two arduino mage to control 64 pcs led

Hello everyone :slight_smile: i am a beginner in arduino.

I would like to control 64pcs led by using 2 adruino mega.

The logic are as below:

  1. arduino1 blink the led in serial ===>
  2. arduino1 finish blinking and send the signal(HIGH) to arduino2 ===>
  3. arduino2 blink the led in serial===>
  4. arduino2 finish blinking and send a signal(HIGH) to arduino1, and both arduino reset by using "asm volatile("jmp 0")"

I am using pin52 as TX and Pin53 as RX for both.

And now the problme is that after arduino1 finish blinking and send out the signal(HIGH) to arduino2, it doesn't wait for the signal from arduino2 but reset by itself.

Can anyone have a look of my code to see whether it is a logical mistake or a coding error.

Thanks a lot.

LunOPA.ino (887 Bytes)

LunOPA_P2.ino (2.17 KB)