Using SparkFun Qwiic Mux Breakout - 8 Channel (TCA9548A)

Despite the usual SF hype “simple to interface with” this mux board will not work for me. Not for RB Artemis, not for any Teensy, not for SF Pro nRF52840 mini, etc. The example code ‘Example1-BasicReadings.ino’ fails consistently because these two functions enableMuxPort and disableMuxPort exist nowhere. Not in Arduino or Arduino libraries, nowhere (search confirms) on this entire computer. If not defined, of course the sketch code will not compile.

What libraries - that I do not have - exist to make this work?

Looking in the tutorial for that board https://learn.sparkfun.com/tutorials/qw … -guide/all

"Warning! Make sure to have the Mux_Control.ino in the same folder when compiling the Example1-BasicReadings.ino sketch file. "

Mux_Control.ino can be found at https://github.com/sparkfun/Qwiic_Mux_T … ontrol.ino

I tried that and the sketch compiles. I don’t have the board to test it with.

/mike

Yes, that works, thanks! The Mux_Control.ino file that came with the SF downloads proved, unfortunately, identical to the example code. Once I followed your link, replaced Mux_Control with the proper code, the code and board run.

I am trying to use the TCA9548A to control three VCNL4040 infrared sensors. These sensors have a fixed address and therefore I want to use the MUX to connect to the sensors one at a time. My problem is that the example code is for an accelerometer and uses the init() method. As far as I can tell, the 4040 library does not have an init() method.

My question is in setup() where it iterates through the for loop what do I put in place of accel.init()?

for (byte x = 0 ; x < NUMBER_OF_SENSORS ; x++)

{

enableMuxPort(x); //Tell mux to connect to port X

accel.init(); //Init the sensor connected to this port

disableMuxPort(x);

}

How do I access the 4040 to turn it on/initialize it.

My object is named:

VCNL4040 proximitySensor;

and this is an example of what I have tried:

proximitySensor.powerOnProximity();

The program compiles but freezes with any method calls using proximitySensor.

in python the sensor has a begin method that gets things going. Like

import qwiic

sen = qwiic.QwiicProximity()

sen.begin

sen.get_Proximity

Not sure if it the same in the library you are using.