I Keep getting errors when I try to upload

Part 1

#include <serLCD.h>

#include <SoftwareSerial.h>


#include <stdlib.h>	// for itoa() call
#include <EEPROM.h>

/* Temperature, Humidity and C02 Environmental controller 
Written for use in mushroom cultivation. 
Written by Anthony Pino. anthony_p1234@yahoo.com

Please feel free to use this code chop change etc...
I take no responsibility for this code blowing up your arduino.

Basically, this program takes in 3 analog inputs, Temperature 1, Temperature 2, C02 and 1 Digital input 
Humidity. Then switches on/off 4 corresponding digital outputs. 
Temperature 1 - Thermistor (voltage)
Temperature 2 - Thermistor (voltage)
Humidity - Capacitor (frequency change given by a change in capacitance in a 555 timer circuit)
C02 - Gas sensor (voltage change, amplified using a precision op-amp)

Digital outputs are intended to be connected to high voltage relays to switch heaters
air pumps and humidifiers etc. Please be carefull when using high voltage.

This code uses the LCD Shield. Normal display shows current readings, Asterixes to the 
right of the display show if one of the relays is on HIGH.
Pressing button 1 toggles configure mode, where up down (button 3+4) buttons change the triggering values 
of the relays. T1,T2,Humidity relays triger when bellow trigger values, C02 relay triggers when above trigger
value.
Pressing button 5 scrolls through the trigger values.
Pressing button 1 again returns to normal display.
Button 2 not used as mine did not work on the LCD shield, feel free to add it.

Values are kept in EEprom for the last 1.34 days. Pressing Right button when in
normal mode pushes it to serial tx. Good for plotting on a xls spreadsheet to see what the values 
were.

*/


/* Humidity Calibration
 Hum     Time between pulses
 75%            788.4
 100.00%	840
 y = mx +c , 
 Where y = Time to between up pulses, x = humidity value
 */
#define HUMIDITY_C  680 //668   
#define HUMIDITY_M 1.6 //1.72	

/* Temperature/Thermistor Calibration
5v--100k_Therm--input--100k --gnd
 y = bit value from input, x = Temperature Value
 y = mx +c    */
#define TEMPERATURE_M 13.31 
#define TEMPERATURE_C 188.1 

/* Carbon dioxide calibration 
 	y = MLogn(x) + C
 	x = e^((y-C)/M)

 	where y is bit value and x is c02 concentration
 C02		Bit Value 
400	279.98

10000	-0.03
  =-87*(LN(N25))+800
 */
#define Carbon_M -83.45 // was-87
#define Carbon_C 768.62 //was 800

/***********************/
/* Interval Definitions*/
#define INTERVAL 30000 //Define ms INTERVAL in between trigerring
#define SENSOR_INTERVAL 400 // SENSOR INTERVAL 
#define BACKLIGHT_TIME 180000 // 1 minute for backlight on after no keypress. NOT BEING USED NOW
#define EE_PROM_INTERVAL 600000 //write data to eeprom every 10minutes

/*******/
/*Define array size to be used for averaging. */
/*In The array, the max value and min value are taken out and the rest averaged*/
/* If 2 or less, it is just averaged*/
#define ARRAY_SIZE 30 



/**********************/
/*Hysterisis Intervals*/
#define TEMP_LO 1
#define TEMP_HI 2
#define HUM_LO 5
#define HUM_HI 0 //trimmed as tends to overshoot
#define CO2_LO 200
#define CO2_HI 100

/**********************/
/* Define input Pins  */
//Analog
#define THERM1  1    // Analog 1 Thermistor 1   voltage
#define THERM2 2    // Analog 2   Thermistor 2 Voltage
#define CARBONDI3 3 // Analog 3
// Digital
#define HUMIDITY2 2 // Digital 2 Humidity  

/**********************/
/*Define output  Pins */
//Digital
#define LEDPIN  13     // select the pin for the LED
#define RELAY1  3      // Relay to start the first heater
#define RELAY2  11      // Relay to start the second heater
#define RELAY3  12     //Relay to start the humidifier
#define RELAY4  13     //Relay to start air pump
#define BACKLIGHT 10   //backlight Pin Value
//Can use pins 0 + 1 if serial not being used.. or use an analog pin.

/******Define Size of storage array for values*/
#define ARRAY_STORE 200 //how many lines to store in eeprom. ARRAY_STORE*4 <1k



/*****************************/
/*set Triggers *************/
int heatTrigger1  = 25; 
int heatTrigger2  = 20; 
int HumTrigger = 80;   
int C02Trigger = 800; 

/***************************/
/* Sensor Value initialize */
int thermValue1 = 0;  
int thermValue2 = 0;
int humValue = 0;
int carbonDiVal = 0;

int therm1[ARRAY_SIZE];
int therm2[ARRAY_SIZE];
int humval[ARRAY_SIZE];
int carbonD[ARRAY_SIZE];



/************************/
/*Set time check ms     */
long last_check = millis();
long sensor_check = millis();
long backlight = millis();
int timing = millis();
long time_eeprom = millis();

/**************************/
/** LCD Shield            */
serLCD lcd(13); // use both lines
char buf[5]; //used in conversion of int to char for lcd

int configure = 0; //use select as an on/off for configuring
int showReading = 0; //select which value to modify  0-3
int adc_key_in = 1024; //Start with -1 key value

int adc_key_val[5] = {
  100, 160, 360, 770, 800 }; //Analog values from Keys on keypad shield

/*
int adc_key_val[5] = {
 65, 218, 393, 601,1000};
 */
int NUM_KEYS = 5;
int key= -1;

char trigger_names[4][15] = {   
  "Temp Trigger 1",
  "Temp Trigger 2",
  "Humid Trigger",
  "C02 Trigger" };

/* Set up index value for storing values in eeprom*/
int k=0;



void setup()
{
  // declare pins as output
  //pinMode(LEDPIN, OUTPUT);  
  pinMode(RELAY1, OUTPUT);
  pinMode(RELAY2, OUTPUT);
  pinMode(RELAY3, OUTPUT);
  pinMode(RELAY4, OUTPUT);

  //Setup averaging arrays
  int i;


  for(i=0; i< ARRAY_SIZE; i++)
  {
    therm1[i] = 512;
    therm2[i] = 512;
    humval[i] = 735;
    carbonD[i] = 645;
  }
  //pinMode(BACKLIGHT,OUTPUT); Backlight on all the time, so comment out this.

  lcd.init();
  lcd.clear();
  digitalWrite(BACKLIGHT,HIGH);
  //Start serial comms with computer
  Serial.begin(115200);



}

void loop() {


  key = get_key(adc_key_in); //In case

  //reset sensor_check if millis() has overflowed
  if( millis() < sensor_check ){ sensor_check = millis();  }

/* This is for backlight off delay.
  if ( (millis() < backlight) || millis() > (backlight + BACKLIGHT_TIME))
  { digitalWrite(BACKLIGHT,LOW); }
*/


  /*Read sensor only after delay of sensor_check*/
  if(millis() - sensor_check > SENSOR_INTERVAL )
  {
    sensor_check = millis();

    int i;

    for (i=0; i < ARRAY_SIZE -1 ; i++) {  
      therm1[i] = therm1[i+1];
      therm2[i] = therm2[i+1];
      humval[i] = humval[i+1];
      carbonD[i] = carbonD[i+1];
    }