Hi, I am currently trying to use four I2C sensors to a TCA9584A and to the microcontroller, and I am not sure with how to code it and to figure out. Could anyone help please.
I'm a novice here but I've used the TCA9548A to talk with 4 Fuel gauge IC's using the 328P but it should be the same idea here.
There is no real library used with the TCA9548A, You call a TCA9548A function as seen in the examples and that selects the I2C channel and then you talk over that channel to the device on that channel.
In my case they are initialized within setup one after the other and within the loop it reads from each fuel gauge one after the other.
The base idea you'd want is to open a port and read the distance sensor and store this value, then open the next port and do the same followed by the other sensors as a stating point
The 4x BME280 example in the second post is what you'd be aiming for.