First Time Qwiic MUX

Kind of a novice when it comes to i2c. I have a Redboard Qwiic, a Qwiic mux, and 3 Micro pressure sensors (SEN,16476).

I have successfully gotten output from a single sensor connected to just the redboard. I have gone through library examples on how to use the MUX, and the closest thing that I see is Example2_DualDistance. Logically it seems that I should be able to modify this for Micro Pressure sensors, but I am stuck.

#include <Wire.h>

#include <SparkFun_I2C_Mux_Arduino_Library.h> //Click here to get the library: http://librarymanager/All#SparkFun_I2C_Mux

QWIICMUX myMux;

#include “SparkFun_MicroPressure.h”

#define NUMBER_OF_SENSORS 3

//#include “SparkFun_VL53L1X.h” //Click here to get the library: http://librarymanager/All#SparkFun_VL53L1X

//SFEVL53L1X **distanceSensor; //Create pointer to a set of pointers to the sensor class// DON’T understand what my equivalent would be??

SparkFun_MicroPressure **pressureSensor;

void setup()

{

Serial.begin(115200);

Serial.println(“Qwiic Mux Shield Read Example”);

Wire.begin();

//Create set of pointers to the class

// distanceSensor = new SFEVL53L1X *[NUMBER_OF_SENSORS]; //This is original example code

pressureSensor = new SparkFun_MicroPressure *[NUMBER_OF_SENSORS]; //This is what I tried

//Assign pointers to instances of the class

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

//distanceSensor = new SFEVL53L1X(Wire);

pressureSensor = new SparkFun_MicroPressure(Wire); //This part won’t compile

I am new to this forum, and I don’t think I am allowed to upload a file yet, or maybe I just don’t know how.

Is this a good method by modifying the example, or is there something better?

In understanding the hookup guide

I’d advise getting one working (like you did), then 2 sensors of the same type working (you’ll need to give them different i2c addresses), and so on

So, editing the code here https://learn.sparkfun.com/tutorials/qw … no-example (scroll down 1 screen) is probably the best starting point…then mix in the library/functions for the pressure sensor and so forth