MAG3110 Virgo robot adaptation

Fork of MAG3110 by JP PANG

Revision:
9:f86b9453bb46
Parent:
8:203af65371e8
Child:
10:33eb06fe479c
diff -r 203af65371e8 -r f86b9453bb46 MAG3110.cpp
--- a/MAG3110.cpp	Mon Aug 01 03:04:29 2016 +0000
+++ b/MAG3110.cpp	Mon Aug 01 05:57:01 2016 +0000
@@ -69,7 +69,7 @@
     _avgZ=(maxZ+minZ)/2;
 }
 
-void MAG3110::get_uT(float *uT[3])
+void MAG3110::get_uT(float *uT)
 {
    char data_bytes[7];
    char d[1];
@@ -78,9 +78,9 @@
    _i2c.write(MAG_ADDR,d,1,true);  
    _i2c.read(MAG_ADDR,data_bytes,7);// Read the 6 data bytes - LSB and MSB for X, Y and Z Axes.
  
-   *uT[0] =  (float)((int16_t)((data_bytes[1]*256) + (data_bytes[2]))) * 0.1;
-   *uT[1] =  (float)((int16_t)((data_bytes[3]*256) + (data_bytes[4]))) * 0.1;
-   *uT[2] =  (float)((int16_t)((data_bytes[5]*256) + (data_bytes[6]))) * 0.1;
+   uT[0] =  (float)((int16_t)((data_bytes[1]*256) + (data_bytes[2]))) * 0.1;
+   uT[1] =  (float)((int16_t)((data_bytes[3]*256) + (data_bytes[4]))) * 0.1;
+   uT[2] =  (float)((int16_t)((data_bytes[5]*256) + (data_bytes[6]))) * 0.1;
 }