       return;
     }
   }
+}
+
+// Set up all the pins and serial connection
+void setup() {
+  Serial.begin(9600);
+  
+  // set up the pins
+  pinMode(heater1, OUTPUT);
+  pinMode(heater2, OUTPUT);
+  pinMode(fan, OUTPUT);
+  pinMode(vent, OUTPUT);
+  
+  // wait for MAX chips to stabilize
+  delay(1000);
+  set_heaters(OFF,OFF);
+
+  // get the initial oven temperature
+  check_temp_sensors();
+  tempInitial = tempAverage;
+ 
+  // init the LCD and fill screen
+  tft.initR(INITR_BLACKTAB);
+  tft.fillScreen(0x0000);
+
+  // init the LCD with user selection
+  // TODO: ADD A GET_PROFILE OR SOMETHING TO GET INFO FROM USER
+  // AND WORK THAT INTO THE STATE MACHINE LOGIC
+}
+
+// TODO: VERIFY THIS LOGIC
+// TODO: FIGURE OUT WHERE DELAYS ARE NECESSARY AND ADD THEM
+void loop() {
+
+  
   delay(100);
 
 } 

}

// Read the joystick and save the value in joystickVal.
void handle_joystick() {

  float a = analogRead(3);


  tempAverage = tempSum/count;
}

// TODO: FIGURE THIS OUT AND EXPLAIN IT BETTER
// Not sure exactly what this is doing.
// It's deciding how to update the heaters, anyway.
void set_heaters() {
  currTempSet=min(350, currTime/1000/60*tempInc+tempInitial);
  tempSetLow= currTempSet-tempErrRange;
  tempSetHigh= currTempSet+tempErrRange;  

  if (tempAverage < tempSetLow && tempAverage > 32) {
    if (tempAverage < tempSetLow - tempThreshold) all_heaters_on();
    else one_heater_on();
  }
  else {
    if (tempAverage > tempSetHigh + tempThreshold)
      all_heaters_off();
    else 
      one_heater_off();
  }
}

// Display information
// TODO: EVERYTHING
void tempPrint()
{
  Serial.print("Current temperature F = ");
  Serial.print(tempSensor1);
  Serial.print(" ");
  Serial.print(tempSensor2);
