I am working a simple little project that has 2 Arduinos that exchange the status of 6 inputs and 6 outputs via serial.
Uno 1 reads the status of 6 pins and writes the status of those pins byte by byte with a start flag and an end flag to be read by Uno 2 to which outputs the status to its own outputs.
Uno1: sends S100000E (to indicate input pin 1 is HIGH)
Uno2: receives S100000E (set output pin 1 HIGH)
Uno2: sends S011100E (indicates pins 2,3,4 are HIGH)
Uno1: receives S011100E (set output pins 2,3,4 to HIGH)
I am trying to use the same code for both Unos and just have the master selectable via a jumper.
I believe I have this working, but I am trying to build in some redundancy. My main concern is the possibility of corrupted data then having some kind of buffer overflowing.
Any comments and suggestions are much appreciated.
This is a link to the code saved on the arduino online editor. Arduino Cloud