       delay(5000);
     }
   }
-  
+  //imu.setSensors(INV_XYZ_GYRO); // Enable gyroscope only
+  imu.setGyroFSR(2000); // Set gyro to 2000 dps
   imu.dmpBegin(DMP_FEATURE_6X_LP_QUAT | // Enable 6-axis quat
-               DMP_FEATURE_GYRO_CAL, // Use gyro calibration
-              10); // Set DMP FIFO rate to 10 Hz
+               DMP_FEATURE_GYRO_CAL |  // Use gyro calibration
+               DMP_FEATURE_SEND_CAL_GYRO, // Send gyro calibrated data
+              100); // Set DMP FIFO rate to 100 Hz
   // DMP_FEATURE_LP_QUAT can also be used. It uses the 
   // accelerometer in low-power mode to estimate quat's.
   // DMP_FEATURE_LP_QUAT and 6X_LP_QUAT are mutually exclusive

   float Great_roll, Great_pitch, Small_yaw;
  // with reverse x and z axis to kite angles
  //'XYZ' convention
  Great_roll  = atan2(2*(q_x*q_w-q_y*q_z), q_w*q_w-q_x*q_x - q_y*q_y+q_z*q_z);
  Great_pitch = asin(2*(q_x*q_z+q_y*q_w));
  Small_yaw   = atan2(2*(q_z*q_w-q_x*q_y), q_w*q_w+q_x*q_x - q_y*q_y-q_z*q_z);

  
  //'ZYX' aeronautical convention


  // attempt to connect to Wifi network:
  while (status != WL_CONNECTED) {
    //Serial.print("Attempting to connect to SSID: ");
    //Serial.println(ssid);
    // Connect to WPA/WPA2 network. Change this line if using open or WEP network:
    status = WiFi.begin(ssid, pass);

    // wait 10 seconds for connection:
    delay(10000);
  }
  //Serial.println("Connected to wifi");
  //printWifiStatus();

  //Serial.println("\nStarting connection to server...");
  // if you get a connection, report back via serial:
  Udp.begin(localPort);

