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?
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.