I need to use two multiplexers to control 15 sensors, now I can read 7 sensors, when I change the direction of the tca9548a to read the other 7 sensors I do not know how to select the channels of the second multiplexer.
You are saying that you know how to change the channel of the first multiplexer but you do not know how to change the channel of the second multiplexer? But the two multiplexers are identical. How can you know how to change one but not the other?
What I am saying is that your question did not make sense to me. You must give more information. What sensors are you using? How have you connected them? What code and libraries are you using? Why do you say that 7 + 7 is 15?
Please read the forum guidance on the sticky post to find out what information we need to help you and how you should post it.
EDIT: I see you have added your sketch and you are using bh1750 light sensors. I will read that.
Do you have a sensor on channel 0 of both multiplexers?
I think the problem may be that when you select channel 0 on the second multiplexer, you do not de-select channel 0 on the first multiplexer. The result is that you have two sensors both at address 0x23. When the Arduino transmits to that address, both sensors will respond and the message will be garbled.
Have you changed one of the multiplexer's addresses to 0x71 by applying a solder bridge on the contracts underneith the board (assuming you are using the AdaFruit board or a clone)?
If so, why are you trying to use the reset pins to select one multiplexer or the other? Does that even work?
PaulRB:
You are saying that you know how to change the channel of the first multiplexer but you do not know how to change the channel of the second multiplexer? But the two multiplexers are identical. How can you know how to change one but not the other?
What I am saying is that your question did not make sense to me. You must give more information. What sensors are you using? How have you connected them? What code and libraries are you using? Why do you say that 7 + 7 is 15?
Please read the forum guidance on the sticky post to find out what information we need to help you and how you should post it.
EDIT: I see you have added your sketch and you are using bh1750 light sensors. I will read that.
hi
what I need is to connect 15 sensors, but I'm doing the test with only two, connecting a bh1750 sensor to channel 0 of the first multiplexer and another to the other channel 0 of the second multiplexer
PaulRB:
Do you have a sensor on channel 0 of both multiplexers?
I think the problem may be that when you select channel 0 on the second multiplexer, you do not de-select channel 0 on the first multiplexer. The result is that you have two sensors both at address 0x23. When the Arduino transmits to that address, both sensors will respond and the message will be garbled.
I think the same but I do not know how to deselect the first multiplexer sensor, so I use the reset pins of the multiplexers but it does not work.
Hı, ı have a project that have 2x tca9548 to control 16 sensor(sht 20).
I can read 8 sensor with only one multiplexer( tca9548) but ı could'nt find the true code for 16 sensor and connection with 2x tca9548.