 #include "platforms/Quadcopter.h"
 
 boolean calibrated = false;
+boolean altHold = false;
+float outputThrottle;
 uint32_t calStartTime;
 const uint8_t CHANNEL_MIN = 32;
 const uint8_t CHANNEL_MAX = 148;

            if(calStartTime + 2000 < millis()) {
                orientation.calibrate(false);
                yawTarget = orientation.getYaw();
                output.standby();
                setState(FLYING);
            }

}

void fly(){
    const float pitchCmd = ((float)APMRadio::get(RADIO_PITCH)-90) /-70.0;
    const float rollCmd  = ((float)APMRadio::get(RADIO_ROLL)-90)  /-70.0;
    const float yawCmd   = ((float)APMRadio::get(RADIO_YAW)-90)   / 90.0;
    const float throttle = ((float)APMRadio::get(RADIO_THROTTLE)-25)/130.0;
    const bool  gearCmd  = (APMRadio::get(RADIO_GEAR) > 90);

    // check for low throttle standby mode
    if(APMRadio::get(RADIO_THROTTLE) <= CHANNEL_MIN){
