       digitalWrite(statePinA, HIGH);
 
     digitalWrite(controlPin, LOW); //Once the output pins have been set properly, pulse the control pin to update the servo.
-    delay(5);
+    delay(7);
     digitalWrite(controlPin, HIGH);
 
     finPosition = goal; //Update the fin state tracking variable

  dataLog = SD.open("datalog.txt", FILE_WRITE);
  dataLog.print("Total time,Flight time,Accel X,Accel Y,Accel Z,Gyro X,Gyro Y,Gyro Z,Baro Press,Baro Temp,Baro Alt,Latitude,Lat Heading,Longitude,Long Heading,GPS Alt,GPS Fix,Fix Quality,Battery %");
  dataLog.close(); //Write the datalog header to the SD card (used for spreadsheet conversion)
}



const int APOGEE_ACCEL_THRESHOLD = 23;
const int APOGEE_TIME_THRESHOLD = 20000;
const int LANDED_BARO_THRESHOLD = 10;
const float MIN_ROLL_THRESHOLD = 0.075;

const float GYRO_DRIFT_FACTOR = 0.006; //Factors for use in calculating completed rotations properly
const float SIMPSON_SCALE_FACTOR = 1.51;
