$20 - Hiring Help For Calling A Sketch While Inside Another Sketch

PAYMENT:
$20 wired via PayPal upon successful completion.

DESCRIPTION:
I'm not sure of the correct wording for the job I need, but it's either a library, an instance, #Define or a class.
I have a temperature control system sketch that I've already written. What I need is that once an event is triggered - temp. is too high, low, etc. - to then execute another pre-written sketch (Send out an SMS text message) inside the temperature control system sketch.

Temperature Control System Sketch
1.8.5

//----------LIBRARIES----------//
#include <TimeLib.h> 
#include <TimeAlarms.h> 
#include <DHT.h>

//----------CONSTANTS----------//
#define DHTPIN 2 //Data pin from the sensor connects to Arduino pin# 2.
#define DHTTYPE DHT11 //DHT 11 (AM2302)
DHT dht(DHTPIN, DHTTYPE); //Initializes the DHT sensor.

//----------GLOBAL VARIABLES----------//
int temperature = 0; //Used by the temperature sensor. Real time temperature data (F).

int chk;
float hum; //Stores humidity value.
float temp; //Stores temperature value.

const int InlineFan = 13; //Names Arduino pin# 13 Inline Fan.
const int PcFans = 12; //Names Arduino pin# 12 PC Fans.
const int HeatingElement = 11; //Names Arduino pin# 11 Heating Element.



//-------------------------//
//----------SETUP----------//
//-------------------------//
void setup()
{
  Serial.begin(9600);
  dht.begin();
  setTime(8, 29, 58, 1, 1, 11); //Used by the alarm system. Sets the time to Saturday 8:29:00am Jan 1 2011
  pinMode(13, OUTPUT); //Sets Arduino pin# 13 as an output.
  pinMode(12, OUTPUT); //Sets Arduino pin# 12 as an output.
  pinMode(11, OUTPUT); //Sets Arduino pin# 11 as an output.
  digitalWrite(13, LOW);
  digitalWrite(12, LOW);
  digitalWrite(11, LOW);
}



//------------------------//
//----------LOOP----------//
//------------------------//
void loop()
{
  digitalClockDisplay(); //Used by the alarm system. Displays the clock printout in the serial monitor.
  TemperatureControl(); //Calls the TemperatureControl function.
}

//----------FUNCTIONS----------//
void TemperatureControl()
{
  hum = dht.readHumidity(); //Read data and store it to variable hum
  temp = dht.readTemperature(true); //Read data and store it to variable temp
  Serial.print("Humidity: ");
  Serial.print(hum);
  Serial.print("%, Temperature: ");
  Serial.print(temp);
  Serial.println("(F)");
  delay(1000); //Delay 1 sec.
  HighTemperature(); //Calls the HighTemperature function.
  LowTemperature(); //Calls the LowTemperature function.
  HighHumidity(); //Calls the HighHumidity function.
}

void HighTemperature()
{
  if (temp >= 85) //If the temperature in the growing chamber rises above 85(F):
  {
    Serial.write(1);
    digitalWrite(InlineFan, HIGH); //Turn ON the relay for the Inline Fan.
    digitalWrite(PcFans, HIGH); //Turn ON the relay for the PC fans.
    TempTooHighTextMessage();
  }
  else if (temp <= 77) //Once the temperature in the growing chamber drops to 77(F) or below:
  {
    Serial.write(2);
    digitalWrite(InlineFan, LOW); //Turns OFF the relay for the Inline Fan.
    digitalWrite(PcFans, LOW); //Turns OFF the relay for the PC fans.
    TempTooHighClearedTextMessage();
  }
}

void LowTemperature()
{
  if (temp <= 70) //If the tempature in the growing chamber drops below 70(F):
  {
    Serial.write(3);
    digitalWrite(HeatingElement, HIGH); //Turn ON the relay for the Heating Element.
    TempTooLowTextMessage();
  }
  else if (temp >= 76) //Once the growing chamber temperature rises back up to 76(F) or greater:
  {
    Serial.write(4);
    digitalWrite(HeatingElement, LOW); //Turn OFF the relay for the Heating Element.
    TempTooLowClearedTextMessage();
  }
}

void HighHumidity()
{
  if (hum >= 75) //If the humidity in the growing chamber rises above 70%:
  {
    Serial.write(5);
    digitalWrite(InlineFan, HIGH); //Turn ON the relay for the Inline Fan.
    digitalWrite(PcFans, HIGH);  //Turn ON the relay for the PC fans.
    HumidTooHighTextMessage();
  }
  else if (hum <= 65) //Once the humidity in the growing chamber drops to 65% or below:
  {
    Serial.write(6);
    digitalWrite(InlineFan, LOW); //Turns OFF the relay for the Inline Fan.
    digitalWrite(PcFans, LOW); //Turns OFF the relay for the PC fans.
    HumidTooHighClearedTextMessage();
  }
}

void digitalClockDisplay()
{
  //Digital clock display of the time.
  Serial.print(hour());
  printDigits(minute());
  printDigits(second());
  Serial.println();
}

void printDigits(int digits)
{
  Serial.print(":");
  if (digits < 10)
    Serial.print('0');
  Serial.print(digits);
}

Send Out An SMS Text Sketch
1.8.5

//----------LIBRARIES----------//
#include <SoftwareSerial.h>

//----------GLOBAL VARIABLES----------//
SoftwareSerial gprsSerial(7, 8);



//-------------------------//
//----------SETUP----------//
//-------------------------//
void setup()
{
  gprsSerial.begin(9600); //GPRS shield baud rate
  Serial.begin(9600); //Starts the serial monitor at 9600 bauds
}



//------------------------//
//----------LOOP----------//
//------------------------//
void loop()
{
  if (Serial.available()) //If there is incoming serial data
    switch (Serial.read()) //Read the character
    {
      case '1': //If the character is '1'
        TempTooHighTextMessage(); //Sends the text message for when the growing chamber is too hot >=85F
        break;
      case '2': //If the character is '2'
        TempTooHighClearedTextMessage(); //Sends the text message for when the high temperature in the growing chamber is okay <=77F
        break;
      case '3': //If the character is '3'
        TempTooLowTextMessage(); //Sends the text message for when the growing chamber is too cold <=70
        break;
      case '4': //If the character is '4'
        TempTooLowClearedTextMessage(); //Sends the text message for when the low temperature in the growing chamber is okay >=76
        break;
      case '5': //If the character is '5'
        HumidTooHighTextMessage(); //Sends the text message for when the humidity in the growing chamber is too high >=75%
        break;
      case '6': //If the character is '6'
        HumidTooHighClearedTextMessage(); //Sends the text message for when the humidity in the growing chamber is okay <=65%
        break;
    }
  if (gprsSerial.available()) //If the shield has something to say
  {
    Serial.write(gprsSerial.read()); //Display the output of the shield
  }
}

//----------FUNCTIONS----------//
void TempTooHighTextMessage()
{
  Serial.println("Sending Text...");
  gprsSerial.print("AT+CMGF=1\r"); //Set the shield to SMS mode
  gprsSerial.println("AT+CMGS = \"+XXXXXXXXXXX\""); //Cell phone number removed because I'm posting the code online.
  gprsSerial.println("Temperature is too high in the growing chamber (85F). System is automatically lowering the temperature now"); //The content of the text
  gprsSerial.print((char)26);//The ASCII code of the ctrl+z is 26 (required according to the datasheet)
  gprsSerial.println();
  Serial.println("Text Sent.");
}

void TempTooHighClearedTextMessage()
{
  Serial.println("Sending Text...");
  gprsSerial.print("AT+CMGF=1\r"); //Set the shield to SMS mode
  gprsSerial.println("AT+CMGS = \"+XXXXXXXXXXX\""); //Cell phone number removed because I'm posting the code online.
  gprsSerial.println("Temperature in the growing chamber has been cooled down successfully (77F)"); //The content of the text
  gprsSerial.print((char)26);//The ASCII code of the ctrl+z is 26 (required according to the datasheet)
  gprsSerial.println();
  Serial.println("Text Sent.");
}

void TempTooLowTextMessage()
{
  Serial.println("Sending Text...");
  gprsSerial.print("AT+CMGF=1\r"); //Set the shield to SMS mode
  gprsSerial.println("AT+CMGS = \"+XXXXXXXXXXX\""); //Cell phone number removed because I'm posting the code online.
  gprsSerial.println("Temperature is too low in the growing chamber (70F). System is automatically raising the temperature now"); //The content of the text
  gprsSerial.print((char)26);//The ASCII code of the ctrl+z is 26 (required according to the datasheet)
  gprsSerial.println();
  Serial.println("Text Sent.");
}

void TempTooLowClearedTextMessage()
{
  Serial.println("Sending Text...");
  gprsSerial.print("AT+CMGF=1\r"); //Set the shield to SMS mode
  gprsSerial.println("AT+CMGS = \"+XXXXXXXXXXX\""); //Cell phone number removed because I'm posting the code online.
  gprsSerial.println("Temperature in the growing chamber has been raised successfully (76F)"); //The content of the text
  gprsSerial.print((char)26);//The ASCII code of the ctrl+z is 26 (required according to the datasheet)
  gprsSerial.println();
  Serial.println("Text Sent.");
}

void HumidTooHighTextMessage()
{
  Serial.println("Sending Text...");
  gprsSerial.print("AT+CMGF=1\r"); //Set the shield to SMS mode
  gprsSerial.println("AT+CMGS = \"+XXXXXXXXXXX\""); //Cell phone number removed because I'm posting the code online.
  gprsSerial.println("Humidity is too high in the growing chamber (75%). System is automatically lowering the humidity now"); //The content of the text
  gprsSerial.print((char)26);//The ASCII code of the ctrl+z is 26 (required according to the datasheet)
  gprsSerial.println();
  Serial.println("Text Sent.");
}

void HumidTooHighClearedTextMessage()
{
  Serial.println("Sending Text...");
  gprsSerial.print("AT+CMGF=1\r"); //Set the shield to SMS mode
  gprsSerial.println("AT+CMGS = \"+XXXXXXXXXXX\""); //Cell phone number removed because I'm posting the code online.
  gprsSerial.println("Humidity in the growing chamber has been lowered successfully (65%)"); //The content of the text
  gprsSerial.print((char)26);//The ASCII code of the ctrl+z is 26 (required according to the datasheet)
  gprsSerial.println();
  Serial.println("Text Sent.");
}

You can't call another sketch. Only one sketch can be uploaded at a time.

You can combine the functionality of one sketch with that of another sketch, if you know what the requirements for the resulting sketch are.

  HighTemperature(); //Calls the HighTemperature function.
  LowTemperature(); //Calls the LowTemperature function.
  HighHumidity(); //Calls the HighHumidity function.

This crap really bugs me. The TemperatureControl() function should be what is determining of the temperature is too low or too high, or the humidity is too high, and should call the appropriate function to deal with the problem.

If it is too cold, calling HighTemperature() doesn't make sense.

Sending a text message every time the temperature is noted to be over 85 doesn't make sense. You want to send ONE message when the temperature becomes over 85 and ONE message when the temperature becomes less than 78 degrees.

What are you sending binary data on the serial port?

That first code is missing the implementation of a lot of functions.

Oh. They are all implemented in the other code. Why? They need to be implemented in the first code.