Efficiency issues with reading/displaying multiple values

I'm having an issue writing a relatively ambitious piece of code. I need to read multiple thermistors, and update a display every few seconds with the name and temperature of a given sensor. Then, if any of the thermistors read above or below a certain range for 20 seconds, it will turn off a relay and display the name of the sensor which triggered it. The code is far from complete, but I'm at something of a standstill. I know the logical tree I want the code to follow, I'm just not sure what tools I need to manage the sensors and display values. Thanks in advance for any advice/resources. I know pointers might be a solution but I couldn't find anything that didn't explain them with the most abstracted examples possible.

#include <neotimer.h>
#include <SmoothThermistor.h>
#include <Adafruit_SSD1306.h>
#include <Wire.h>



SmoothThermistor tBed(23);
SmoothThermistor tHotend(24);
SmoothThermistor tAmbient(25);
SmoothThermistor tPSU(26);

Neotimer OLEDtimer = Neotimer(3000);
Neotimer overTimer = Neotimer(200000);
Neotimer tempTimer = Neotimer(35);


//initilization constants for thermistors
#define REFERENCE_RESISTANCE   10000
#define NOMINAL_RESISTANCE     100000
#define NOMINAL_TEMPERATURE    25
#define B_VALUE                3950


int tempArray[4]; //holds current temperature values
int thermArray[4] = {23,24,25,26}; //holds pin values for 4 thermistors
int maxArray[4] = {120,300,80,90}; //max temps for bed, hotend, ambient, and PSU respectively

#define relayPin 2
int sensorSwitch = 1 //cycles once per update of the displau, to change the sensor temp that's displayed


void setup() {

Serial.begin(9600);
display.begin(SSD1306_SWITCHCAPVCC, 0x3D);
smoothThermistor.useAREF(true);

//initialize and turn on relay
pinMode(relayPin, OUTPUT);
digitalWrite(relayPin, HIGH);


}

void loop() {
//short timer used so as not to read the ADC too fast
if(tempTimer.repeat(35)){
updateTemp();
// here is where I'm not sure how to switch between sensors without a for loop, which would be too fast for the adc
  }
}

//updtates the display every 3.5 sec
if(OLEDtimer.repeat(3500)){
  drawDisplay();
  //here i'm also not sure how to pass the name of the current sensor that needs to be displayed to the display function
  
}
for(int i=1; i<= 4; i++){
  if (tempArray[i] < maxArray[i])
  overTemp(thermArray[i]);
}

    
    
    
  
}

void updateTemp(int sensor){
 tempArray[sensor] = thermArray[sensor].temperature
//here I'm not sure if I'm allowed to pass the pin number straight to the "temperature" function of the smoothThermistor library


}

void drawDisplay(int temp){
   display.setTextSize(2);
  display.setTextColor(WHITE);
  display.setCursor(10,0);
  display.clearDisplay();
  display.println("Temp = ");
  display.print(temp);
  display.display();
}

void overTemp(int sensor)
while (sensor).temperature > ???) // how do I get which overtemperature value I'm supposed to be comparing against based on the sensor I'm reading?

Nothing abstract about pointers. They are the ACTUAL address of what is pointed to. It may also be used in arithmetic to add or subtract some data length to the pointer. Such as a pointer to the beginning of a character array, which may have 1 added to it to point to the next character.

The compiler assigns the value(address) to the pointer at compile time so it is usable right at the start of your program.

Paul

// here is where I'm not sure how to switch between sensors without a for loop, which would be too fast for the adc

The for-next loop is a loop that maintains an index.

With Arduino you have void loop() that runs over and over. Whatever indexes your sketch maintains, void loop() is the driver.

So which array member you want to deal with next time loop() runs, you set before the current loop() finishes.

You code for the future this way, expect change and control it, that index doesn't have to march 0-1-2-3 as a for-loop for example, it can change in response to real world conditions just as fast as your void loop() runs.