08-13-2024 10:46 AM
Hi,
as stated in the subject I have a PCA9548 multiplexer, I am trying to control multiple HTU21D Humidity and temperature sensors, but for now I am just trying to read from 1 channel, 1 temperature reading to figure out how it works.
Here is the setup for this project :
The part that I have been unsure of is how do I go from telling the device I want to use the address of 70 for the multiplexer and then from there tell the program that within the multiplexer I need to go into X channel and look for X adress
Here is what I have so far, but I get an error at the write function saying : "NI-845x: The slave did not acknowledge an address+direction byte transmitted by the I2C master..."
This is a working example for just reading 1 sensor when directly connected to the NI8451 which works ( I simplified it to just read once for simplicity's sake )
Thank you for any help or suggestions I can get on this !!!
08-15-2024 07:45 PM
Since all your sensors connected to the MUX are the same address, you need to ensure you configure the MUX (switch actually) to connect to only one channel when you read the sensor.
The order of execution should look as follows,
Here is a simple code to configure the PCA9548 to connect N channels