Accel

Dependents:   Hexi

Fork of FXOS8700 by Aswin Sivakumar

Files at this revision

API Documentation at this revision

Comitter:
tdh50
Date:
Mon Apr 10 16:45:24 2017 +0000
Parent:
2:98ea52282575
Child:
4:b7334257ebe8
Commit message:
Accel Page

Changed in this revision

FXOS8700.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/FXOS8700.cpp	Tue Dec 22 00:22:57 2015 +0000
+++ b/FXOS8700.cpp	Mon Apr 10 16:45:24 2017 +0000
@@ -66,9 +66,9 @@
    accelmagi2c.write(FXOS8700_I2C_ADDRESS,d,1,true);  // Read the 6 data bytes - LSB and MSB for X, Y and Z Axes.
    accelmagi2c.read(FXOS8700_I2C_ADDRESS,data_bytes,7);
    
-   a_data[0] =  ((float)((int16_t)(((data_bytes[1]*256) + (data_bytes[2])))>> 2) * 0.000244);
-   a_data[1] =  ((float)((int16_t)(((data_bytes[3]*256) + (data_bytes[4])))>> 2) * 0.000244);
-   a_data[2] =  ((float)((int16_t)(((data_bytes[5]*256) + (data_bytes[6])))>> 2) * 0.000244);
+   a_data[0] =  (((int16_t)(((data_bytes[1]*256) + (data_bytes[2])))>> 2) * 0.000244);
+   a_data[1] =  (((int16_t)(((data_bytes[3]*256) + (data_bytes[4])))>> 2) * 0.000244);
+   a_data[2] =  (((int16_t)(((data_bytes[5]*256) + (data_bytes[6])))>> 2) * 0.000244);
    
  }