MPRLS pressure sensor Increase sample rate

I'm working with two MPRLS pressure sensors and a TCA9548A multiplexer, to allow me to read both sensors on the arduino. I found that for one sensor to increase the sample rate, all I had to do was set the EOC_PIN to a GPIO pin and wire it up and cancel the delay in the Adafruit_MPRLS.cpp file. But now I have two sensors and two EOC pins, (one for each sensor). How do I watch both pins in the same loop, and set the TCA9548A to the correct channel any time one of the pins goes high, which I have been told shall, increase the sample rate for both?

This is the attempt I have made at the moment, that doesn't work.

#include <Wire.h>
#include "Adafruit_MPRLS.h"


#define TCAADDR 0x70


#define RESET_PIN  -1  // set to any GPIO pin # to hard-reset on begin()
#ifdef EOC_PIN
 #define EOC_PIN  A3
#else
 #define EOC_PIN  A4
#endif
Adafruit_MPRLS mpr = Adafruit_MPRLS(RESET_PIN, EOC_PIN);



/* Assign a unique ID to this sensor at the same time */
Adafruit_MPRLS mpr1 = Adafruit_MPRLS(1);
Adafruit_MPRLS mpr2 = Adafruit_MPRLS(2);




unsigned long time;

void tcaselect(uint8_t i) {
  if (i > 7) return;
 
  Wire.beginTransmission(TCAADDR);
  Wire.write(1 << i);
  Wire.endTransmission();  
}

void setup() 
{
  Serial.begin(115200);
  /* Initialise the 1st sensor */
  tcaselect(2);
  if (! mpr1.begin()) 
  {
    Serial.println("Failed to communicate with MPRLS sensor 1, check wiring?");
  }


 /* Initialise the 2nd sensor */
  tcaselect(7);
  if (! mpr2.begin()) 
  {
    Serial.println("Failed to communicate with MPRLS sensor 2, check wiring?");
  }
  Serial.println("Time (ms) \t Sensor 1 (hPa) \t Sensor 2 (hPa) ");
}



void loop() 
{
  time = millis();
  Serial.print(time);
  tcaselect(2);
  float pressure_hPa_1 = mpr1.readPressure();
 

  Serial.print("\t");
  Serial.print("\t");
  Serial.print(pressure_hPa_1);
  
  tcaselect(7);
  float pressure_hPa_2 = mpr2.readPressure();

  Serial.print("\t");
  Serial.print("\t");
  Serial.println(pressure_hPa_2);
  
}

I would remove that line

Adafruit_MPRLS mpr = Adafruit_MPRLS(RESET_PIN, EOC_PIN);

and replace these two lines

Adafruit_MPRLS mpr1 = Adafruit_MPRLS(1);
Adafruit_MPRLS mpr2 = Adafruit_MPRLS(2);

by

Adafruit_MPRLS mpr1 = Adafruit_MPRLS(RESET_1, A3);
Adafruit_MPRLS mpr2 = Adafruit_MPRLS(RESET_2, A4);

You have to set RESET_1 and RESET_2 to the pin numbers where you connected the reset lines of the two sensors (I doubt you really used 1 and 2 but I don't know actually).

I tried that and it didn't work, the serial monitor is still blank, which was how it appears with the previous code.

I tried that and it didn't work, the serial monitor is still blank, which was how it appears with the previous code.

If the serial monitor is blank, you have a hardware problem. Post a complete wiring diagram of your setup!

What type of Arduino are you using?