     ctrl.yawf = 0.0;
     ctrl.pitchf = 0.0;
     ctrl.rollf = 0.0;
-    ctrl.throttle = 0.0;
+    ctrl.throttlef = 0.0;
     connectionLostCount++;
     digitalWrite(statPin_g, LOW);
     digitalWrite(statPin_r, HIGH);

    lastShortTime = micros();
    lastShortTimeMS = millis();
    imu.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);
    bool updatedMag = imu.getMagReading( &mx, &my, &mz);
    gyro.update(gx, gy, gz, elapsed_si);


    accel.update(ax, ay, az);

    gyro.correctXY(accel.x, accel.y);

    if(updatedMag){ 
        compass.update(mx, my, mz, ax, ay, az);

        //gyro.correctZ(compass.yaw); 
        gyro.correctZ(0.0);
    }    


    
    if (ctrl.live) {
        pid_update();
        motor_update();
    }else{
        motor_off();
    }
  }


    //                  ulong deltaTime_UnitsPerSecond,
    //                  float correction_weight
    //                  bool invX, invY, invZ)
    gyro.config(2000, 1000000, 0.005, false, true, true);
    accel.config(false, true, false);//args are for inverting axis
    compass.config(152.0, 197.5, -172.5, 1.076132, 1.039761, 1.0); // see compass_calibrate()
  
