

Instead of stating what I have tried, I will instead say what my objective is perhaps there is a better way of accomplishing this. Perhaps I am misunderstanding how I2C works. Note that I am not sure if the multiple Wire.begin() statements are correct - do I need to re-join the bus as a master before sending? Or can I just beginTransmission / send / endTransmission even if I am in slave mode already? Note that this code is for Device 1 the addresses are switched on Device 2: it joins the bus as address 0x2, and sends a message to 0x1.

Once the transmission is complete, re-join as slave address 0x1, and register the receiveEvent function pointer again. When we need to send a message, re-join bus as master, and send. Initially join the bus as slave device with address 0x1 * digital pin 10 and ground, and an LED (with a resistor) to digital pin 9. * with a 1k pullup resistor connected to each line. * Connections: Arduino analog pins 4 and 5 are connected between the two Arduinos, * Arduino, which flashes an LED correspinding to button state. * Sample Multi Master I2C implementation. After that it will respond very infrequently.

Basically the first time or two you hit one of the buttons, the other light will flash, but after a few presses it stops responding. Well, I have some code which seems to work intermittently, but I can't figure out what is causing the failure. Each chip is both a message producer and consumer the proof of concept code I am using will listen for a button press on one board, and send a message to the other to toggle an LED. I am trying to set up a couple Arduinos linked in a multi master I2C design.
