Does anyone have experience with i2c on the raspberry pi? I’ve run a test to see how quickly i can process this function:
void PWM::setPWM(int channel, int on, int off)
{
wiringPiI2CWriteReg8(fd, LED0_ON_L+4*channel, on & 0xFF);
wiringPiI2CWriteReg8(fd, LED0_ON_H+4*channel, on >> 8);
wiringPiI2CWriteReg8(fd, LED0_OFF_L+4*channel, off & 0xFF);
wiringPiI2CWriteReg8(fd, LED0_OFF_H+4*channel, off >> 8);
}
What i’m finding is that it takes around 2-3ms to send those bytes. Is that expected? It seems slow. Any hints on how to speed this up? The wiringPi documentation suggests using it’s GPIO tool to increase baudrate:
gpio load i2c 1000
but increasing that hasn’t changed anything. any tips would be helpful ( @jvcleave or @joshuajnoble i’m hoping you guys have a hint on this ). thanks! I’ll post if i find anything.