       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

#include <SPI.h>
#include <WiFiNINA.h>
#include <WiFiUdp.h>

int status = WL_IDLE_STATUS;
#include "arduino_secrets.h" 

  float q_x = imu.calcQuat(imu.qx);
  float q_y = imu.calcQuat(imu.qy);
  float q_z = imu.calcQuat(imu.qz);

  gyroX = imu.calcGyro(imu.gx);
  gyroY = imu.calcGyro(imu.gy);
  gyroZ = imu.calcGyro(imu.gz);
  
//  SerialPort.println("Q: " + String(q_w, 4) + ", " +
//                    String(q_x, 4) + ", " + String(q_y, 4) + 
//                    ", " + String(q_z, 4));

 //  Inspired from https//github.com/amcmorl/motorlab/blob/master/rp3/rotations.py
 //  but two rotations were corrected
