Noob global, local and pointed variables question

I'm building a climate control that opens and closes servos to introduce warm or cold air. I'm connecting it to a nextion display and so far it's going well but I'm stuck trying to understand how to pass variables between functions. I've set up a few global variables but one doesn't seem to be updating. frontcabintemp. I can get it to print out of the section where it is populated with a DHT11 but I can not use the variable value in any of the other functions.

#include <DHT.h> // temp sensor libraries
#define DHTPIN 7  // Digital pin connected to the DHT sensor
#define DHTTYPE DHT11  // Needed to define the type of sensor being used - DHT11
DHT dht(DHTPIN, DHTTYPE);

// This section is for the servo
#include <Servo.h> // servo library
Servo frontheatservo;  // create servo object to control the front heat servo
Servo frontcoolservo;  // create servo object to control the front cool servo
//Servo backheatservo;  // create servo object to control the back heat servo
//Servo backcoolservo;  // create servo object to control the back cool servo



// setting global variables
String endChar = String(char(0xff)) + String(char(0xff)) + String(char(0xff)); // Nextion display expects 0xFF three times when sending. This automates that addition.

int frontsettemp = 72; // default front cabin temp
int frontheatservoval;
int frontcoolservoval;
int frontcabintemp;


void setup() {
  Serial.begin(9600);
  Serial1.begin(9600); // serial connection between the mega and the display
  dht.begin();
  frontheatservo.attach(9);  // attaches the servo on pin 9 to the servo object
  frontcoolservo.attach(10);  // attaches the servo on pin 10 to the servo object
}




// start of main loop
void loop() {
  delay(500);

  Serial1.print("page0.n0.val=" + String(frontsettemp) + endChar); // this prints the frontsettemp to the touch display

  measurefronttemp(); // this calls the measurefronttemp function
  grabscreendata(); // this calls the screen reader
  movefrontservos(); // this calls the move front servos section
}



// this section reads the front cabin temp from a DHT11

void measurefronttemp() {
  // Read temperature as Fahrenheit (isFahrenheit = true)
  int frontcabintemp = dht.readTemperature(true);

  // Check if any reads failed and exit early (to try again).
  if (isnan(frontcabintemp)) {
    Serial.println(F("Failed to read from DHT sensor!"));
    return;
  }
  Serial1.print("page0.n1.val=" + String(frontcabintemp) + endChar); // this writes the frontcabintemp to the screen.
}


// this section creates an empty string variable and grabs the text from the display out of the serial1 channel

void grabscreendata() {
  if (Serial1.available()) {
    String data_from_display = "";
    delay(30);
    while (Serial1.available()) {
      data_from_display += char(Serial1.read());
    }
    Serial.println(data_from_display);
    sendData(data_from_display);
  }
}




// this section increases or decreases the frontsettemp based on what's returned from the dispaly in grabscreendata

void sendData(String data_from_display) {
  if (data_from_display == "frontsettemp_increase") {
    frontsettemp = frontsettemp + 1;
  }
  if (data_from_display == "frontsettemp_decrease") {
    frontsettemp = frontsettemp - 1;
  }
}




void movefrontservos() {

  Serial.println("------------------------");
  Serial.println(frontcabintemp); // this will not populate not matter what I do?
  Serial.println(frontsettemp);


  // this is the front heating side
  if ((frontsettemp >= frontcabintemp + 20) && (frontsettemp <= frontcabintemp + 100)) {
    frontheatservoval = 180;
    frontheatservo.write(frontheatservoval);
    frontcoolservo.write(0);
  }
  else if ((frontsettemp >= frontcabintemp + 10) && (frontsettemp <= frontcabintemp + 19.99)) {
    frontheatservoval = 90;
    frontheatservo.write(frontheatservoval);
    frontcoolservo.write(0); {
    }
  }
  else if ((frontsettemp >= frontcabintemp + 5) && (frontsettemp <= frontcabintemp + 9.99)) {
    frontheatservoval = 20;
    frontheatservo.write(frontheatservoval);
    frontcoolservo.write(0); {
    }
  }
  else if ((frontsettemp >= frontcabintemp + 1) && (frontsettemp <= frontcabintemp + 4.99)) {
    frontheatservoval = 10;
    frontheatservo.write(frontheatservoval);
    frontcoolservo.write(0); {
    }
  }
  else if ((frontsettemp >= frontcabintemp) && (frontsettemp <= frontcabintemp + .99)) {
    frontheatservoval = 0;
    frontheatservo.write(frontheatservoval);
    frontcoolservo.write(0); {
    }
  }
  else if ((frontsettemp <= frontcabintemp) && (frontsettemp >= frontcabintemp - .99)) {
    frontcoolservoval = 0;
    frontcoolservo.write(frontcoolservoval);
    frontheatservo.write(0); {
    }
  }
  else if ((frontsettemp <= frontcabintemp - 1) && (frontsettemp >= frontcabintemp - 4.99)) {
    frontcoolservoval = 10;
    frontcoolservo.write(frontcoolservoval);
    frontheatservo.write(0); {
    }
  }
  else if ((frontsettemp <= frontcabintemp - 5) && (frontsettemp >= frontcabintemp - 9.99)) {
    frontcoolservoval = 20;
    frontcoolservo.write(frontcoolservoval);
    frontheatservo.write(0); {
    }
  }
  else if ((frontsettemp <= frontcabintemp - 10) && (frontsettemp >= frontcabintemp - 19.99)) {
    frontcoolservoval = 90;
    frontcoolservo.write(frontcoolservoval);
    frontheatservo.write(0); {
    }
  }
  else if ((frontsettemp <= frontcabintemp - 20) && (frontsettemp >= frontcabintemp - 100)) {
    frontcoolservoval = 180;
    frontcoolservo.write(frontcoolservoval);
    frontheatservo.write(0); {
    }
  }
}

You have 2 different variables named fontcabintemp. One is s global and the other is declared in the measurefronttemp() function

Updating one will not update the other

this create new local variable frontcabintemp, completely independent from global one.
This frontcabintemp exists only until exit from measurefronttemp() function.

Please find any C-programming textbook and read the chapter about variable scope.

Maybe this tutorial on scope will help.

Global variables do not have to be passed into or returned from functions as their value is available throughout the sketch. There is actually slightly more to it than that but that is good enough for now

The value of a variable declared within a function can be passed to another function by including it in the brackets of a function call as long as the function is defined to accept it

funcA(someVar);  //pass the value of someVar to function funcA()
void funcA(byte x)  //a function to receive a byte value and put it in the x variable

The value of a variable can be returned from a function by using the data type to be returned in the function definition just before its name then explicitly returning the value from the function using the return keyword

int aFunc()  //a function that promises to return an int value
{
//code here
return 123;  //return a value
}
int someValue = aFunc()  //call a function and get back an int value

Drop int