First post here on the forum! Been getting a lot of help here from all the past posts and I am grateful for such a great community.
I have been trying to use Repeated Start by using the PIGPIO library using bitbanging.
However, I have not been able to get it working and I keep getting:
-82 error: i2c write failed.
For example, when I try to initialize the RGB sensor using the following line:
err = bbI2CZip(2,RGB_init_buf,sizeof(RGB_init_buf),NULL,0);
with the following initialization buffer:
char RGB_init_buf[] = {4, RGB_ADDR, // set up Chip address
2, 7, 2, (RGB_COMMAND_BIT | TCS34725_ATIME), 0xEB, 3, //
2, 7, 2, (RGB_COMMAND_BIT | TCS34725_CONFIG), 0x00, 3, //
2, 7, 2, (RGB_COMMAND_BIT | TCS34725_CONTROL), 0x01, 3, //
2, 7, 2, (RGB_COMMAND_BIT | TCS34725_ENABLE), TCS34725_ENABLE_PON,3, //power on
0 // EOL
};
I get an error code of -82
, corresponding to a failed I2C write.
I set up my I2C bus as follows:
if (gpioInitialise() < 0) {
printf("Pigpio library initialization failed\n");
return -1;
}
if (bbI2COpen(2,3,100000) != 0){
printf("Bit Banging initialization failed\n");
return -1;
}
Anyone have any idea what could be problem?