I'm struggling to get wiringPi to work with my TCA9548a on my Pi 3 using C code. I believe I do have a working channel switcher, but I am unable to detect my sensors (BNO055). This is how I am switching channels where "address"=fd, SWITCH = 0x04, switch register for the TCA9548a, and "channel" is what chanel I want to switch to.
Code: Select all
void BNO055::switch_channel(){
int check;
check = wiringPiI2CWrite(SWITCH, channel);
//~ check = wiringPiI2CWriteReg8(address, SWITCH, channel);
if (check==-1)
printf("could not switch");
else
printf("Switched to channel: %i \n",channel);
}This is what I have defined for the mux channels: In binary, they are 10000000, 01000000, 00100000, etc.
Code: Select all
//MUX Channels
#define CH0 0x01
#define CH1 0x02
#define CH2 0x04
#define CH3 0x08
#define CH4 0x10
#define CH5 0x20
#define CH6 0x40
#define CH7 0x80In summary:
1) Are the channel 8-bit switch mask values correct?
2) Can I quickly see if the sensors are being detected using the dtoverlay without rewriting all of my code?
Much thanks
