Couple 2 A.mega2560 : ok ?

There are a couple of articles on the forum that might be of interest. The main one is Demonstration code for several things at the same time.

Other ones can be found ad stickies in
Introductory Tutorials - Arduino Forum.

Personally, when using two Megas, I would use serial communication for communication between them. See https://forum.arduino.cc/t/serial-input-basics-updated/ for ideas.