5 unsigned char ReadPCF8591(char address, char channel) {
7 unsigned char id=PCF8591_ID+(address<<1);
10 //fprintf (stderr, "I2C bus busy, retrying.\n");
13 // set output enable, no autoincrement
14 i2cTransmitBuffer[0]=(channel&0x03)+0x40;
16 // read 2 bytes, since the first one is the old value
17 if (I2CSendReceive(id, 1, 2))
20 return i2cReceiveBuffer[1];