I'm using I2C master/slave communication between two Arduino, using this tutorial:
I now have the need to send data both directions. Is it not possible to do both of these on the same Arduino?
Wire.write ((byte *) &xC, sizeof x);
The writes are events driven tasks. Can I have both Arduino run a Wire.onReceive? And they act as master and slave, but at different times for different events? There is a chance that two events happen simultaneously and both try to master on pin 4 and 5 of the analog I/O, but it's unlikely and it's ok if that happens, as long as the Arduinos fail gracefully (not freeze up, pretend the transmission didn't happen).
Perhaps there a better way of having two Arduinos talk to each other?