small informations about I2C

hello guys i come back for your experience

i wish to make a i2c connection to send some imputs analog data from a master arduino to other 3 slaves
my truble is like that …
1 what library should i use … all do the same thing but i found …Wire.h, I2C_Anything.h, I2C.h i know if someone made that library was made for a reason in i don’t know what are the advanteges of each one
2 it is indicated to enable high speed data 400kHz?
3 continue sending mode it is indicated to be used?

Using the normal Wire library, you can use this: http://arduino.cc/en/Tutorial/MasterWriter

400kHz is possible. You have to take a look at the wiring, the pullup resistors and the voltages. If that is all good, 400kHz is no problem.

What is continue sending mode ?

yes i made a connection .. with wire and with i2c.anything i had found some tutorials modified them ... but i dont know witch is better !

if the wire library ... have some bugs and with other too they removed it ....

/*******************************************
 Sample sketch that configures an HMC5883L 3 axis
 magnetometer to continuous mode and reads back 
 the three axis of data.
 Code compiles to a size of 1500 bytes
 Equivalent Wire Library code compiles to 2032 bytes
 *******************************************/

#include <I2C.h>

#define HMC5883L  0x1E 

int x = 0;
int y = 0;
int z = 0;


void setup()
{
  I2c.begin();
  I2c.write(HMC5883L,0x02,0x00); //configure device for continuous mode
}

void loop()
{
  I2c.read(HMC5883L,0x03,6); //read 6 bytes (x,y,z) from the device
  x = I2c.receive() << 8;
  x |= I2c.receive();
  y = I2c.receive() << 8;
  y |= I2c.receive();
  z = I2c.receive() << 8;
  z |= I2c.receive(); 
}


/* Wire library equivalent would be this 

//#include <Wire.h>

#define HMC5883L  0x1E 

int x = 0;
int y = 0;
int z = 0;


void setup()
{
  Wire.begin();
  Wire.beginTransmission(HMC5883L);
  Wire.send(0x02);
  Wire.send(0x00);
  Wire.endTransmission();
}

void loop()
{
  Wire.beginTransmission(HMC5883L);
  Wire.send(0x03);
  Wire.endTransmission();
  Wire.requestFrom(HMC5883L,6);
  x = Wire.receive() << 8;
  x |= Wire.receive();
  y = Wire.receive() << 8;
  y |= Wire.receive();
  z = Wire.receive() << 8;
  z |= Wire.receive(); 
}

searching for answers i found this site http://dsscircuits.com/articles/arduino-i2c-master-library.html and the guy posted his example … i started to look at it and saw that continuous mode and i did not knew what is with it

That page is 2 years old.
The Arduino Wire library didn’t have ‘repeated start’, but now it has.
http://arduino.cc/en/Reference/WireEndTransmission

Are you using the HMC5883L ?
I suggest to use the normal Arduino Wire library.

When you have a very specific problem with it, you might try the I2c library later on.

first of all i did not look how old was that page ..MY BAD, MY BAD second i just want to make a normal communication betwin 4 arduinos, 1 as master and other 3 as slaves hey u know when everithing works fine what will be the world if we not complicate it .... ok i will hold on the wire library... when it will be finished i will upload the sketches for everyone have a nice day man and thenx alot for your advice

I have a I2C Master, it is a Arduino Mega2560 with Ethernet Shield.
That Arduino Mega has a 5V I2C bus and a 3.3V I2C bus using a level shifter.

The Arduino Mega runs a website on a microSD card, updates to ThingSpeak.com and get the NTP time. When a certain webpage is shown, data is requested from the I2C Slaves for the page.

The Slaves have both the onRequest and onReceive handlers.
For one Slave, I can read and write the EEPROM via I2C (writing is very slow).
It works well… but it has a disadvantage. When I want to change a sensor value on the webpage, I sometimes have to update three things: the website on the microSD card; the sketch for the Mega; the sketch for the Slave.

I only use the Wire library. The Wire library is blocking for some situations. When I had a shortcut between the SDA and SCL, the Arduino Mega was not running anymore. But I keep on using the Arduino Wire library.

I encoutered a bug in the Wire library. Adding a delay solved it.