Minimum Temperature and Max temperature input

Hello guys, i need help on my project where i input temperature apparently i can inout 1 temperature data which is maximum. Now i want to input 2 temperature which is minimum and maximum. Is it possible for slave to receive both of them but save them on a 2 different variables?Btw im using SPI for master and Slave

//SPI MASTER (ARDUINO)


#include<SPI.h>                
#include<Wire.h>
#include <LiquidCrystal_I2C.h>
#include <Keypad.h>

const byte ROWS = 4; 
const byte COLS = 3; 
byte value = 0;

char hexaKeys[ROWS][COLS] = {
  {'1', '2', '3'},
  {'4', '5', '6'},
  {'7', '8', '9'},
  {'*', '0', '#'}
};

byte rowPins[ROWS] = {9, 8, 7, 6}; 
byte colPins[COLS] = {5, 4, 3}; 

Keypad customKeypad = Keypad(makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS);
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);
void setup (void){
  lcd.begin(20,4); 
  lcd.backlight();
   
  
  SPI.begin();                            //Begins the SPI commnuication
  SPI.setClockDivider(SPI_CLOCK_DIV8);    //Sets clock for SPI communication at 8 (16/8=2Mhz)
  digitalWrite(SS,HIGH);                  // Setting SlaveSelect as HIGH (So master doesnt connnect with slave)
}

void loop(void)
{
  byte Mastersend;          

  lcd.setCursor(0,0);
  lcd.print("Enter Ref Temp:");
  
  char key = customKeypad.getKey();
   if (key != NO_KEY)
     {
      if ( (key >= '0') && (key<= '9') )
        {
         value = value *10;
         value = value + key -'0';
         lcd.setCursor(0,1);
         lcd.print(value);
        }
      if ( key == '#' ) // Maximum Temperature
       {
        digitalWrite(SS, LOW);                             
        SPI.transfer(value); //Send the mastersend value to slave also receives value from slave
        
        lcd.clear();
        value = 0;
       }
       if ( key == '*' ) // Minimum Temperature
       {
        digitalWrite(SS, LOW);                             
        SPI.transfer(value); //Send the mastersend value to slave also receives value from slave
        
        lcd.clear();
        value = 0;
       }
     }
}
//Code for the slave board
#include<Wire.h>
#include <LiquidCrystal_I2C.h>
#include <EEPROM.h>
#include "DFRobot_SHT20.h"
#include<SPI.h>

//i2c pins
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); // 
//temp&humid
DFRobot_SHT20    sht20;


// declaration of variable for relay
const int window1 = 2;
const int window2 = 3;
const int exhaustfan = 4;
const int orbitfan = 5;
const int fanheater = 6;
const int mistpump = 7;
const int heater =8;
//

int resetPin = 8;

volatile boolean received;
volatile byte Slavereceived;

void(* resetFunc) (void) = 0; //declare reset function @ address 0

void setup() {
  Serial.begin(9600);

  pinMode(MISO,OUTPUT);                   //Sets MISO as OUTPUT (Have to Send data to Master IN 

  SPCR |= _BV(SPE);                       //Turn on SPI in Slave Mode
  received = false;

  SPI.attachInterrupt();                  //Interuupt ON is set for SPI commnucation
  
  lcd.begin(20,4);
  lcd.backlight();//Power on the back light
  
  sht20.initSHT20();     // Init SHT20 Sensor
  delay(100);
  sht20.checkSHT20();    // Check SHT20 Sensor
  // Relay modules
    pinMode(window1,OUTPUT);
    pinMode(window2,OUTPUT);
    pinMode(exhaustfan,OUTPUT);
    pinMode(orbitfan,OUTPUT);
    pinMode(fanheater,OUTPUT);
    pinMode(mistpump,OUTPUT);
    pinMode(heater,OUTPUT);
  //

  pinMode(resetPin, OUTPUT);  
  //Temperature And Humidity
    float humd = sht20.readHumidity();        // Read Humidity
    float temp = sht20.readTemperature();   // Read Temperature
    lcd.setCursor(0,0);
    lcd.print("Temperature:"); 
    lcd.print(temp);
    lcd.print("C");
    delay(100);
    lcd.setCursor(0,1);
    lcd.print("Humidity:");
    lcd.print(humd);
    lcd.print("%");
    delay(100);
  //

}

//This is where i save my data received from master

ISR (SPI_STC_vect){             //Inerrrput routine function 
  Slavereceived = SPDR;         // Value received from master if store in variable slavereceived
  received = true; 
  EEPROM.update(0,Slavereceived);//Sets received as True
  resetFunc();
}



//void receiveEvent(int howMany) {
//  byte byteVal = Wire.read();//Receive value from master board
//  lcd.setCursor(0,3);
//  lcd.print("Ref Temp:");
//  lcd.print(byteVal);
//  EEPROM.update(0,byteVal);
//  
//}

void loop() {
  
  byte eepromval = EEPROM.read(0);
  byte eepromles = eepromval - 2;
  Serial.println("Data");
  Serial.print(eepromval);
  Serial.print(eepromles);
  Serial.println();
  float humd = sht20.readHumidity();        // Read Humidity
  float temp = sht20.readTemperature();    // Read Temperature
  lcd.setCursor(0,0);
  lcd.print("Temperature:"); 
  lcd.print(temp);
  lcd.print("C");
  delay(100);
  lcd.setCursor(0,1);
  lcd.print("Humidity:");
  lcd.print(humd);
  lcd.print("%");
  lcd.setCursor(0,3);
  lcd.print("Ref Temp:");
  lcd.print(eepromval);
  delay(100);
  
  v1(eepromval,eepromles);
}
void v1(byte eepromval,byte eepromles){
  //Temperature And Humidity
    float humd = sht20.readHumidity();        // Read Humidity
    float temp = sht20.readTemperature();    // Read Temperature
    lcd.setCursor(0,0);
    lcd.print("Temperature:"); 
    lcd.print(temp);
    lcd.print("C");
    delay(100);
    lcd.setCursor(0,1);
    lcd.print("Humidity:");
    lcd.print(humd);
    lcd.print("%");
    lcd.setCursor(0,3);
    lcd.print("Ref Temp:");
    lcd.print(eepromval);
    delay(1000);
    //
    if(temp >= eepromval){//process #1
      lcd.setCursor(0,2);
      lcd.print("Process 1");
      digitalWrite(window1,LOW); // relay #1
      digitalWrite(window2,HIGH);  //relay #2
      digitalWrite(exhaustfan,LOW); //relay #3
      digitalWrite(orbitfan,LOW); //relay #4
      digitalWrite(fanheater,HIGH); //relay #5
      digitalWrite(mistpump,LOW); //relay #6
      digitalWrite(heater,HIGH); //relay #8
    }else{
      v2(eepromval,eepromles);
  }
}
void v2(byte eepromval,byte eepromles){
  float humd = sht20.readHumidity();        // Read Humidity
  float temp = sht20.readTemperature();    // Read Temperature
  lcd.setCursor(0,0);
  lcd.print("Temperature:"); 
  lcd.print(temp);
  lcd.print("C");
  delay(100);
  lcd.setCursor(0,1);
  lcd.print("Humidity:");
  lcd.print(humd);
  lcd.print("%");
  lcd.setCursor(0,3);
  lcd.print("Ref Temp:");
  lcd.print(eepromval);
  delay(1000);
  if(temp < eepromval){
    lcd.setCursor(0,2);
    lcd.print("Process 2");
    digitalWrite(window1,LOW);
    digitalWrite(window2,HIGH); 
    digitalWrite(exhaustfan,LOW); 
    digitalWrite(orbitfan,LOW); 
    digitalWrite(fanheater,HIGH); 
    digitalWrite(mistpump,HIGH);
    digitalWrite(heater,HIGH);
  }else{
    v3(eepromval,eepromles);
  }
}
void v3(byte eepromval,byte eepromles){
  float humd = sht20.readHumidity();        // Read Humidity
  float temp = sht20.readTemperature();    // Read Temperature
  lcd.setCursor(0,0);
  lcd.print("Temperature:"); 
  lcd.print(temp);
  lcd.print("C");
  delay(100);
  lcd.setCursor(0,1);
  lcd.print("Humidity:");
  lcd.print(humd);
  lcd.print("%");
  lcd.setCursor(0,3);
  lcd.print("Ref Temp:");
  lcd.print(eepromval);
  delay(1000);
  if(temp < 26){
    lcd.setCursor(0,2);
    lcd.print("Process 2");
    digitalWrite(window1,HIGH);
    digitalWrite(window2,LOW); 
    digitalWrite(exhaustfan,HIGH); 
    digitalWrite(orbitfan,LOW); 
    digitalWrite(fanheater,LOW); 
    digitalWrite(mistpump,HIGH);
    digitalWrite(heater,LOW);
  }else{
    v4(eepromval,eepromles);
  }
}
void v4(byte eepromval,byte eepromles){
  float humd = sht20.readHumidity();        // Read Humidity
  float temp = sht20.readTemperature();    // Read Temperature
  lcd.setCursor(0,0);
  lcd.print("Temperature:"); 
  lcd.print(temp);
  lcd.print("C");
  delay(100);
  lcd.setCursor(0,1);
  lcd.print("Humidity:");
  lcd.print(humd);
  lcd.print("%");
  lcd.setCursor(0,3);
  lcd.print("Ref Temp:");
  lcd.print(eepromval);
  delay(1000);
  if(temp < eepromles || temp >= 26){
    lcd.setCursor(0,2);
    lcd.print("Process 3");
    digitalWrite(window1,LOW); 
    digitalWrite(window2,HIGH); 
    digitalWrite(exhaustfan,HIGH); 
    digitalWrite(orbitfan,HIGH); 
    digitalWrite(fanheater,HIGH); 
    digitalWrite(mistpump,HIGH);
    digitalWrite(heater,HIGH);
  }else{
    v1(eepromval,eepromles);
  }
}

You have to send it as a packet with framing symbols, at least an end marker.

do you have an example? i am really new to this spi thing. Thank you

You know you can't just send them alternately, because there isn't a reliable way to know which is min and which is max. So if you always send min, max, and then some special number like zero, you can read them in that order, check for the zero (or whatever special symbol) to know that your reads are synchronized.

You may object, "what if one of my data is zero (or equal to the special symbol)". That can be a problem and the solutions to problems like that is why there are so many ways to design a packet.

Hello aarg
Thank you for your response. I will try that.