 //  Serial.print (cpt++,DEC);
 //  Serial.print ("\t");
   
- 
+  // End of line
+  Serial.println("");
+  delay(500);  
  
   // ____________________________________
   // :::  accelerometer and gyroscope ::: 
-
-  // Read accelerometer and gyroscope
-  uint8_t Buf[14];
-  I2Cread(MPU9250_ADDRESS,0x3B,14,Buf);
+}
+  
+
+  void accelerometer_subr()
+  {
+ // Read accelerometer data  
+    I2Cread(MPU9250_ADDRESS,0x3B,6,Buf);
   
   // Create 16 bits values from 8 bits data
-  
-  // Accelerometer
-  int16_t ax=-(Buf[0]<<8 | Buf[1]);
-  int16_t ay=-(Buf[2]<<8 | Buf[3]);
-  int16_t az=Buf[4]<<8 | Buf[5];
-
-  // Gyroscope
-  int16_t gx=-(Buf[8]<<8 | Buf[9]);
-  int16_t gy=-(Buf[10]<<8 | Buf[11]);
-  int16_t gz=Buf[12]<<8 | Buf[13];
-  
-    // Display values
-  
-  // Accelerometer
-  Serial.print("Accel: ");
-  Serial.print (ax,DEC); 
-  Serial.print ("\t");
-  Serial.print (ay,DEC);
-  Serial.print ("\t");
-  Serial.print (az,DEC);  
-  Serial.print ("\t");
-  
-  // Gyroscope
-  Serial.print("Gyro: ");
-  Serial.print (gx,DEC); 
-  Serial.print ("\t");
-  Serial.print (gy,DEC);
-  Serial.print ("\t");
-  Serial.print (gz,DEC);  
-  Serial.print ("\t");
-
-  
+    ax=-(Buf[0]<<8 | Buf[1]);
+    ay=-(Buf[2]<<8 | Buf[3]);
+    az=Buf[4]<<8 | Buf[5];
+
+  //print accelerometer data  
+    Serial.print (ax,DEC); 
+    Serial.print ("\t");
+    Serial.print (ay,DEC);
+    Serial.print ("\t");
+    Serial.print (az,DEC);  
+    Serial.print ("\t");
+  }
+
+
+  void gyro_subr()
+  {
+  // Read gyroscope data
+    I2Cread(MPU9250_ADDRESS,0x43,6,Buf);
+  
+  // Create 16 bits values from 8 bits data
+    int16_t gx=-(Buf[0]<<8 | Buf[1]);
+    int16_t gy=-(Buf[2]<<8 | Buf[3]);
+    int16_t gz=Buf[4]<<8 | Buf[5];
+  
+  // print gyroscope data
+    Serial.print (gx,DEC); 
+    Serial.print ("\t");
+    Serial.print (gy,DEC);
+    Serial.print ("\t");
+    Serial.print (gz,DEC);  
+    Serial.print ("\t");
+
+  }
   // _____________________
   // :::  Magnetometer ::: 
 
   
   // Read register Status 1 and wait for the DRDY: Data Ready
-  
+
+  void subr_magnetometer()
+  {
+
   uint8_t ST1;
   do
   {


// Counter
long int cpt=0;

void callback()
{ 

  intFlag=false;
  
  // Display time
  Serial.print (millis()-ti,DEC);
  Serial.print ("\t");

  
