 /*
-<<<<<<< Updated upstream
- * Notre Dame Rocket Team Roll Control Payload Master Code V. 0.91
- * Aidan McDonald, 2/1/17
- * Kyle Miller, 2/2/17
- * 
- * Most recent changes:
- * Moved the GPS enable code again, to <600 ft post-apogee
- * Incorporated receiving data from the ground station
-    * Added two master flags to control sensor enabling and fin control disabling
- * Revised the data transmission section to send altitude data when gps/gyro data isn't being sent
- * Changed Pin Variables to match what the inputs to the servo will be 
- * 
- * To-dones:
-  * Basic switch-case structure
-  * Incorporation of Adafruit sensor code
-  * Added GPS functionality
-  * Integration of radio-transmission/reception code
-  * Datalogging capacity (untested)
-  * 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:
-  * 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
-  * NO REALLY, EVERYTHING
-   *  Ada Sensors
-   *  SD Saving
-   *  Servo Control
-   *  Flight Staging
-   *  Etc., etc.
- * 
- */
-=======
    Notre Dame Rocket Team Roll Control Payload Master Code V. 1.0.0
    Aidan McDonald, 2/4/17
+   Kyle Miller, 2/2/17
 
    Most recent changes:
    Reconfigured the roll control subroutine for the new, increment-based servo mode

  digitalWrite(RFM95_RST, HIGH);

  pinMode(controlPin, OUTPUT);
<<<<<<< Updated upstream
  pinMode(inputA, OUTPUT);
  pinMode(inputB, OUTPUT);
=======
  pinMode(statePinA, OUTPUT);
  pinMode(statePinB, OUTPUT);
>>>>>>> Stashed changes

  accel.begin();
  bmp.begin();
  gyro.enableAutoRange(true);
  gyro.begin();
  SD.begin(cardSelectPin);//Initialize the sensors and SD card
<<<<<<< Updated upstream
  
  digitalWrite(controlPin, HIGH); //Enable servo
  servoOnFlag = true;
  digitalWrite(inputA, HIGH); //Set servo to "home" position
  servoHomeFlag = true;
=======

  digitalWrite(controlPin, LOW); //Set the servo control pin to low to make sure it doesn't pulse accidentally
>>>>>>> Stashed changes

  //Manual radio reset
  digitalWrite(RFM95_RST, LOW);


    if (rotationCounter > 2) {
      Set_Servo(finPosition, abs(finPosition - 2)); //This will output LEFT if finPosition = RIGHT, and vice-versa
      endRollFlag = true;
    }
  }
  else { //At this point, continue to make adjustments to prevent roll
    if (abs(event.gyro.z) < MIN_ROLL_THRESHOLD)
    {
      Set_Servo(finPosition, CENTER);
    }
    else if (event.gyro.z > 0) //Again, this assumes positive gyro values are clockwise.
