Read I2C data from Arduino slave

@Embring Sorry for the delayed response - but I have finally found time to look at it with a logic analyzer!

I was able to get your sketch to run by removing the Serial.println() in loop. My guess is that Arduino might either disable interrupts during parts of the interaction with the UART, or - perhaps - that the work in parallel makes it so that the Arduino can’t keep up with the rapid demands of the I2C bus.

Working on this I found two improvement - which you can find here, and which should become part of the upcoming Processing release: https://github.com/gohai/processing/commits/io-i2c

First: just doing a read() without a write() crashed - this is fixed now.
And secondly: while I can’t change the I2C bus speed, I can set a “timeout” too 100ms. This gives the bus partner more time to respond, and made it very smooth & stable.

Please give this a try when the next release is out - could also be a nice idea to write an example sketch for this type of communication (haven’t even thought of using the Arduino as a “slave” device).