i2c communication between 1 master and four slaves

Hi,
i am trying to communicate one master arduino with three slave arduinos.i want to write data to slaves from master and master to slaves frequently.the problem is i want to send comma separated values from master to slave and get back from them.please help me to do the required.
In the master arduino i have given as
long x1 =0.02435253553455;
long x = 1.335346345654;
wire.beginTransmission(4); //4 is slave 1 board address
wire.write(x);
wire.write(",");
wire.write(x1);
wire.endTransmission();

In the slave i have given as
while(wire.available())
{
char c =wire.read()
Serial.print(c);
}
int x =wire.read()
Seria.print(x);}
please help me asap.if you have solution please forward to my email id:
roshan.cheluva@gmail.com

How to use this forum

Longs are 4 byte variables, think you will need to break them up to send out as 4 bytes.
See the Wire.h library to confirm.
Same on the receive side, will need to receive the 4 bytes and then put them back together.

NickGammon has a great writeup on I2C here

Thanks a lot.i completed project using i2c_Anything. :slight_smile:

Hi all,
how many int /long/float variables we can send from at a time from master to slave using I2C_Anything.please help me asap.

How to pass string data using i2c_Anything.please help me.
For example char c ="data";int t1="data1"
i2c_Anything(c);i2c_Anything(t1);