Not too long ago I purchased another arduino board to go with my current one, so now I have an arduino uno and an arduino mega 2560 version. I would like to be able to wore them together so that one either controls the other or they both work together as one big board. How would you wore it and if so how would you code it?
1- use serial between the boards to pass commands and info. This will require you to borrow or design a command/data interface protocol. Also, there are 3 common serial interfaces to use (do web searches to learn what these are and how to use them on an arduino):
a- aync (UART) at TTL levels
b- SPI
c- I2C
2- some other combination of parallel/serial interface.
What ever you choose should be based on the project requirements so this needs to be defined first.
I2C a two wire serial communication system. Hardware on Arduino to support.
SPI a three/four wire serial communication system. Hardware on Arduino to support.
UART a two write serial communication system. The backbone of RS-232/RS-422. Hardware to support TLL version. May need level converter for true RS-232.
All these have their own pros and cons. I2C and SPI are a master/slave system where one device controls the interface. UART is peer to peer.
If you roll your own serial or parallel system, it could be master/slave or peer-peer.