Page 1 of 1

I2C interface device

PostPosted: Tue Nov 03, 2015 2:15 pm
by Collaborative
Dear all,

I am trying to implement I2C communication between Parallella (master) and Arduino (slave).
What it is not clear for me is the write function:

/* Using I2C Write, equivalent of
i2c_smbus_write_word_data(file, reg, 0x6543) */
buf[0] = reg;
buf[1] = 0x43;
buf[2] = 0x65;
if (write(file, buf, 3) != 3) {
/* ERROR HANDLING: i2c transaction failed */

my question is: what are exactly buf[0],buf[1],buf[2]?
Is it buf[0] the register of Arduino where I would like to write?
Are buf[1] and buf[2] the data to send from Parallella to Arduino?

Thanks! :mrgreen: