Problem: Syncing two Arduinos Master/Slave

djsfantasi

Joined Apr 11, 2010
7,213
Hi ES Probably .......... I rewired the output to pin 3 from 5 incase it got damaged Re Kieth but no change. Now I extended the delay in Keiths code to delay (50) from (10) ......I watching it now and I will keep you updated
Did you use pin 5 before? You need to move both pins to new pins to be sure. You cannot use pins 4 & 5 in a new test. And if you used pin 3, I’d pick two new pins, that aren’t pins 3, 4 or 5.
“Stalling” suggests to me that you have a memory overflow. The program updates a location in memory that is beyond defined locations. If myIndex equals 10, writing to anArray[myIndex] when you have the following definition:

char anArray[10];​

Will overwrite code or values by mistake.

Or a similar problem. Such as having misplaced braces in the vicinity of a loop, like a “for” loop, which results in myIndex referencing an illegal memory location containing valid code or values.

This is the point I was trying to make in post #14. You didn’t respond so perhaps you didn’t understand.
 

Thread Starter

d333gs

Joined Nov 7, 2020
12
Ok , it is working, Big Thanks everybody! Really Big thanks ,Kieth for the code & guidance .
I made a lot of newbe mistakes but learnt a lot too!

I moved the 'hand shake' to the point in the code just before a 'flash' which was the part in the code that really showed the sync problem .
The Hand shake takes place then the two screen flash in sync and then continues in sync.
I ran it all night and it is still in sync.

Here is a link to the code
https://pastebin.com/0uXE8saz
 
Last edited:

Thread Starter

d333gs

Joined Nov 7, 2020
12
Another question!
If I have 4 Arduinos composed of two pairs linked by a handshake between pin 3&4 ...........Could I
have the two pairs do a handshake between each other , between pins 2&5 for example.???????????????
All using the same power source.: Photo attached: HAND SHAKES.jpg
 

KeithWalker

Joined Jul 10, 2017
1,398
It should be no problem but you are going to have to work this one out. I already did my bit. Just remember - none will restart the loop until they are all ready.
 
Top