Needed for FXAS21000 NXP gyroscope
Fork of FXAS21000 by
Revision 4:79bf9c15d4d7, committed 2016-04-10
- Comitter:
- roberthill04
- Date:
- Sun Apr 10 20:33:06 2016 +0000
- Parent:
- 3:a8f83b52f4df
- Commit message:
- Final Program for Cycle Fit
Changed in this revision
FXAS21000.cpp | Show annotated file Show diff for this revision Revisions of this file |
FXAS21000.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/FXAS21000.cpp Mon Jun 02 17:36:38 2014 +0000 +++ b/FXAS21000.cpp Sun Apr 10 20:33:06 2016 +0000 @@ -14,7 +14,7 @@ _i2c.read ( i2c_addr, d, len); } -void FXAS21000::begin(void) +void FXAS21000::begin(void) { char data[2]; // write 0000 1000 = 0x08 to gyro control register 1 to place FXAS21000 into @@ -43,7 +43,7 @@ return(d); } -void FXAS21000::ReadXYZ(float * a) +void FXAS21000::ReadXYZ(double * a) { char d[7]; int16_t t[6]; @@ -54,9 +54,9 @@ t[2] = ((d[5] * 256) + ((unsigned short) d[6])); //printf("%X\r\n", (int) d[0]); - a[0] = (float) t[0] * 0.003125; - a[1] = (float) t[1] * 0.003125; - a[2] = (float) t[2] * 0.003125; + a[0] = (double) t[0] * 0.003125; + a[1] = (double) t[1] * 0.003125; + a[2] = (double) t[2] * 0.003125; }
--- a/FXAS21000.h Mon Jun 02 17:36:38 2014 +0000 +++ b/FXAS21000.h Sun Apr 10 20:33:06 2016 +0000 @@ -54,7 +54,7 @@ * * @param floating point array where the results will be placed */ - void ReadXYZ(float * a); + void ReadXYZ(double * a); /** * Get the Gyro values as signed 16 bit value