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

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.");
}