I've setup two Arduinos connected via an optocoupler on a breadboard.
One Arduino is a sender and sends pulses to the optocoupler causing the diode to turn on.
When this happens the other Arduino has it's input connected to the emitter. This is interpreted as 1 on the receiver side. Or if the diode is off it's a 0 on the receiver side.
My problem is getting them to sync. I'm currently using delay which I'm starting to realize is a horrible idea since they go out of sync after about 2 characters have been sent. So I wonder are there any better solutions to syncing them?