   * Running-average calcs for critical sensor values and Simpson's Rule integration of gyro data
   * Multi-sensor verification of flight progress switch-case transitions (untested)
   * Github Sync system working
+  * Packet transmission/reception over radio (ADD THIS TO GROUND STATION CODE TOO!!)
  * 
  * To-dos:
- *  THE CODE IS ALREADY TOO BIG!!!!!
-      *  This is a pretty serious problem, considering there is still a significant amount of code that needs to be written. Part of the problem is that the
-      *  Adafruit flight controller uses four different libraries, each of which eats up memory space. Maybe replace our flight sensor package? Otherwise,
-      *  we're going to need to severely ramp down the scale of our operations...
-  * Figure out what the ground station will be transmitting and configure the receiver accordingly
-  * Figure out what data the payload transmits pre-burnout
+  * Reconfigure the servo control for the new control scheme!!!!!!!
   * Revise and enhance the staging/thresholds, particularly burnout/apogee accel values
   * Reconfigure the SD datalogging section to allow for easy spreadsheet conversion
   * TEST EVERYTHING


void loop() {

/* Get a new sensor event */ 
  sensors_event_t mainEvent;
  gyro.getEvent(&mainEvent);
  accel.getEvent(&mainEvent); // Assume Z-axis is vertical for accel/gyro?
  bmp.getEvent(&mainEvent);
  if(gpsOnFlag)
  char c = GPS.read(); //Must call GPS.read() at some point for data transmission to occur

  if(startTime != 0)
  flightTime = millis() - startTime; //Timer backup variable

  Record_Data(mainEvent);//Save sensor data (accel, baro, time, GPS) to the SD card
  if(radioWorkingFlag) {
  Radio_Transmit(); //Transmit/receive select data
  }

  BufferUpdate(mainEvent);
 
switch(flightState) { //Switch statement for entire rocket flight
  /* 

    uint8_t len = sizeof(buf); //Variables to contain received message
    if (rf95.recv(buf, &len)) //If message is intact; this call also fills buf and len with data
   {

    //Two very important flags from the ground station, sent in triplicate.
    //masterEnableFlag enables the flight sensors to begin liftoff detection; finOverrideFlag acts as a master interrupt to halt in-flight fin rotation.
    
    if(buf[0] || buf[1] || buf[2])
        masterEnableFlag = true;
      else
        masterEnableFlag = false;

     if(buf[3] || buf[4] || buf[5])
        finOverrideFlag = true;
     else
        finOverrideFlag = false;
   }
  }  
  }
