One Arduino Mega as master, another as slave?

Can you use an Arduino Mega to take inputs from another Arduino Mega just like a multiplexer. If it helps I'm trying to use VatSim (HCSCI - Intro) and they recommend 1 master board and many multiplexers. I have multiple Arduino Megas and was wondering if I could use the other megas as multiplexers controlled by one single Arduino Mega?


Yes, it is possible in theory. An Arduino expert could do this. But an expert would probably choose another way. For a beginner, it would be too difficult. Each Arduino would require a separate sketch which would need to be written and debugged. Debugging multiple sketches is very difficult because you don't always know which sketch has a bug, or, worse, if a bug is caused by a combination of sketches. Then there is the complexity of getting the Arduino to communicate with each other.

A more practical approach would be to use a single Arduino and sketch. In order to increase the number of input and outputs, various extra chips can be used which don't require code to be uploaded to them, and attach to the Arduino via a "bus" which allows multiple chips to be attached to the same wires. A good example if this is the i2c bus. A wide range of i2c chips are available which can drive displays and leds, read digital or analog controls, actuate motors, etc.

One of the simplest i2c chips is pcf8574, which can read 8 switches light 8 LEDs, or any combination of the two. A more advanced chip is ht16k33 which can drive up to 8 x 15-segment or 16 x 7-segment led displays, or 128 separate LEDs, or combinations of those. It can also read up to 21 switches.

Ok. All of that sounds really good. I’ll check it all out. I really appreciate your reply! Thanks so much!