Java I2C communications

cant u use linux read() and write() system calls using i2c_dev…

I use inQt next code:

if((fd_adc = open("/dev/i2c/0", O_RDWR))!=NULL)
io_adc=ioctl(fd_adc, I2C_SLAVE, 0x48);
date[0]=0x121c;
write(fd_adc,date,2);
}
it runs.

2012/7/12 kiran nayak <niekiran@gmail.com>

when =x48 is the code of the i2c chip conected on board. you can use i2cdetect to know that code.

For read:
read(fd_adc,&value, 2); When 2 is the number of bytes. The value will be loaded in “value” .

2012/7/12 Ramon Benavent <ramon.benavent@gmail.com>