How to connect multiple arduinos together

Hi again,

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?

Thanks for the help

Lots of options:

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.

This is kinda embarrassing but what exactly is uart and i2c?

A UART is actually a piece of hardware that supports a common type of serial interconnection. Google the terms for an indepth explanation.

Okay thanks.

OP needs to do a little reading

yeah I know Im really new at this so I havnt had time to do much reading on the specifics of all this. its been kinda one problem at a time

Quick tutorial:

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.

Thanks a ton! I’ll have to try one of those.