General Questions about ic2 connection between 2-3 arduinos

Hi i have some questions about ic2 connection

  1. Can the Master Arduino read and write to slave arduinos?

examble ... Master reads from SlaveArduino1 And then writes to slaveArduino2

if i have understand well .. a slave can be only as read or write

  1. If i want the Master Arduino do a special Function (lets say stop everything and writes error in a display) when for one reason cant read from the SlaveArduino , is any special command to use?

What happens generally in a Master Arduino if it doesnt get any response from a slaveArduino? will continue work or will stack trying to read the Slave ?

one option i have think is to declare one I/O of the SlaveArduino as an output and connect it to a I/O interrupt of the Master Arduino , so when the slaveArduino is out off power the MasterArduino see it and stop all functions

Thanks in Advance

  1. yes

  2. no special command just normal stuff.

If their is no response your incoming buffer will never be filled and you will get stuck reading the response. So implement a time out, just like an I2C device address checker.

I just tried to get an Arduino to talk to an ATtiny over I2C.
The Wire library apparently has it well covered. No time outs or anything special implemented on my side - if I do a Wire.requestFrom() when the slave isn’t there the subsequent wire.read() returns those 255 value bytes.

Thanks :slight_smile: