I2C communication for 2 arduino uno as slaves

Hi,
I'm using Arduino uno board as master and 2 Arduino uno boards as slaves. How does the master differentiate two slave Arduino? What device address has to be given for the slaves?
Thanks in advance.

yashaswini_s:
Hi,
I’m using Arduino uno board as master and 2 Arduino uno boards as slaves. How does the master differentiate two slave Arduino? What device address has to be given for the slaves?
Thanks in advance.

you assign the ‘slaves’ addresses.

// in each of the slave's setup()
Wire.begin(slaveID);  // slaveID can be any value from 0..127, but to be compatible with other I2C
// devices please choose a number from 8..127.  0..7 are special use. 0 is used for 'all devices' and 1..7 for 16bit I2C devices.

you will have to write 2 response handlers for each of your slaves, OnRequest() and OnReceive(). These two function respond to the I2C master read/write requests.

Chuck.