   }
   while (!(ST1&0x01));
 
-  // Read magnetometer data  
-  uint8_t Mag[7];  
-  I2Cread(MAG_ADDRESS,0x03,7,Mag);
-  
-
+  // Read magnetometer data   
+    I2Cread(MAG_ADDRESS,0x03,7,Mag);
+  
   // Create 16 bits values from 8 bits data
-  
-  // Magnetometer
-  int16_t mx=-(Mag[3]<<8 | Mag[2]);
-  int16_t my=-(Mag[1]<<8 | Mag[0]);
-  int16_t mz=-(Mag[5]<<8 | Mag[4]);
-  
-  
-  // Magnetometer
-  Serial.print("Compass: ");
-  Serial.print (mx+200,DEC); 
-  Serial.print ("\t");
-  Serial.print (my-70,DEC);
-  Serial.print ("\t");
-  Serial.print (mz-700,DEC);  
-  Serial.print ("\t");
-  
-  
-  
-  // End of line
-  Serial.println("");
-  Serial.flush();
-  
-}
+    mx=-(Mag[3]<<8 | Mag[2]);
+    my=-(Mag[1]<<8 | Mag[0]);
+    mz=-(Mag[5]<<8 | Mag[4]);
+  
+  
+  // print magnetometer data
+    Serial.print (mx,DEC);//(mx+200,DEC); 
+    Serial.print ("\t");
+    Serial.print (my,DEC);//(my-70,DEC);
+    Serial.print ("\t");
+    Serial.print (mz,DEC);//(mz-700,DEC);  
+    Serial.print ("\t");
+  
+  }
+  
+   
+
+
+
+
+
+
+
+
+
+

  // Request continuous magnetometer measurements in 16 bits
  I2CwriteByte(MAG_ADDRESS,0x0A,0x16);
  
  pinMode(13, OUTPUT);
  Timer1.initialize(10000);         // initialize timer1, and set a 1/2 second period
  Timer1.attachInterrupt(callback);  // attaches callback() as a timer overflow interrupt
  
  

{
  // Arduino initializations
  Wire.begin();
  Serial.begin(9600);
  
  // Set accelerometers low pass filter at 5Hz
  I2CwriteByte(MPU9250_ADDRESS,29,0x06);
