You need to put some delay between the writes. At least 4ms. Here is the additional code to use a simple 4ms timer. Declaration as below. int main(int argc, char **argv){ int i,j; /* filedescriptor and name of device */ int d; char *dn=DEFAULT_I2C_BUS; /* filedescriptor and name of data file */ int ...