     //                  ulong deltaTime_UnitsPerSecond,
     //                  float correction_weight
     //                  bool invX, invY, invZ)
-    gyro.config(2000, 1000000, 0.01, false, true, true);
+    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()
   

        logger.writeOnFull();        
    }*/
    print("IMU "); print(lastShortTimeMS); print(" "); print(gyro.posX); print(" "); print(gyro.posY); print(" "); print(gyro.posZ); print("\n");
    print("GRATE "); print(lastShortTimeMS); print(" "); print(gyro.rateX); print(" "); print(gyro.rateY); print(" "); print(gyro.rateZ); print("\n");
    print("GRSUM "); print(lastShortTimeMS); print(" "); print(gyro.rsumX); print(" "); print(gyro.rsumY); print(" "); print(gyro.rsumZ); print("\n");
    print("ACC "); print(lastShortTimeMS); print(" "); print(accel.x); print(" "); print(accel.y); print(" "); print(compass.yaw); print("\n");
    //print("MAG "); print(lastShortTimeMS); print(" ");print(compass.mx); print(" "); print(compass.my); print(" "); print(compass.mz); print("\n");

  }while(!stable);
  
  compass.update(int(mx_avg), int(my_avg), int(mz_avg), int(ax_avg), int(ay_avg), int(az_avg));
  compass.zero();
  accel.setRestingPosition(0.0, 0.0, 1.0);
  //accel.setRestingPosition(int(ax_avg), int(ay_avg), int(az_avg)); // only use if craft is perfectly level
  accel.update(int(ax_avg), int(ay_avg), int(az_avg));
