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:

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.write(HMC5883L,0x02,0x00); //configure device for continuous mode

void loop()
{,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()

void loop()
  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 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.

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 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.