Hi,
I'm seeking a way to send binary words to an I2C line following sensor with my Duemilanove.
With the Wire library I can send 7bit words, with the last bit added by the function called (1/0 for read/write)
I want to send a full 8bit word (by specifying myself the read.write bit)
I tried to dvelve into the Wire library, and :
To send data :
Wire.beginTransmission(sensorAddress);
Wire.send(data);
Wire.endTransmission();
beginTransmission set the address, send fill the transmission buffer,
and endTransmission runs some checks then take the address, the buffer and sends them to the advice.
endTransmission() uses the twi.c library by calling the twi_writeTo function
This is where I need your help !
Because I can't understand where is sent the data...
It's like it is somwhere else.
For a full comprehension of my problem, i have to send this sequence in my sensor :
i2c_start();
i2c_write(currAddress);
i2c_write(0x00);
i2c_write(0xA0);
i2c_stop();
i2c_start();
i2c_write(currAddress);
i2c_write(0x00);
i2c_write(0xAA);
i2c_stop();
i2c_start();
i2c_write(currAddress);
i2c_write(0x00);
i2c_write(0xA5);
i2c_stop();
i2c_start();
i2c_write(currAddress);
i2c_write(0x00);
i2c_write(newAddress);
i2c_stop()
And i don't know how to "translate" it into the Arduino's Wire language
The twi library can be found on the libraries\Wire\utility folder
Thanks,
LGui