Hello,

I've been trying to connect an i2c compass to the Tobi.
datasheet: http://www.sparkfun.com/datasheets/Components/HMC6352.pdf
The device  is 1.8V logic, so I'm using a level converter.

The problem is that every write or read returns -1.
There is no signal on pins 23 and 24.

What might be wrong?


Thanks,
Mathias

int fh = open("/dev/i2c-3", O_RDWR);
if (fh < 0 ) printf("Could not open\n");
if (ioctl(fh, I2C_SLAVE, 0x21)) printf("Could not set i2c address\n");
   
    while(1){
        status = write(fh, 'A', 1);
        printf("write = %d\n",status);
        wait_ms(10);
        status = read(fh, data, 2);
        printf("read = %d\n",status);
        angle |= data[0];
        angle <<=8;
        angle |= data[1];
        printf("angle = %d\n",angle);
        wait_ms(1000);
    }