Modification to FXOS8700Q for use in Data Logger project
Dependencies: FXOS8700Q MotionSensor
Dependents: GPS_6Axis_DataLogger_SD_UDP
Fork of FXOS8700Q by
Diff: FXOS8700Q.cpp
- Revision:
- 7:c53dda05b8cf
- Parent:
- 6:cdc362f08339
- Child:
- 8:52116f8fb3da
diff -r cdc362f08339 -r c53dda05b8cf FXOS8700Q.cpp --- a/FXOS8700Q.cpp Thu Apr 24 16:30:31 2014 +0000 +++ b/FXOS8700Q.cpp Fri Apr 25 16:45:51 2014 +0000 @@ -223,15 +223,15 @@ } void FXOS8700Q_mag::getX(float * x) { - *x = (float(getAccAxis(FXOS8700Q_M_OUT_X_MSB))/4096.0f); + *x = (float(getAccAxis(FXOS8700Q_M_OUT_X_MSB)) * 0.1f); } void FXOS8700Q_mag::getY(float * y) { - *y = (float(getAccAxis(FXOS8700Q_M_OUT_Y_MSB))/4096.0f); + *y = (float(getAccAxis(FXOS8700Q_M_OUT_Y_MSB)) * 0.1f); } void FXOS8700Q_mag::getZ(float * z) { - *z = (float(getAccAxis(FXOS8700Q_M_OUT_Z_MSB))/4096.0f); + *z = (float(getAccAxis(FXOS8700Q_M_OUT_Z_MSB)) * 0.1f); } void FXOS8700Q_mag::getX(int16_t * d) { @@ -265,7 +265,7 @@ void FXOS8700Q_mag::getAxis(MotionSensorDataCounts &data) { int16_t acc; uint8_t res[6]; - readRegs(FXOS8700Q_OUT_X_MSB, res, 6); + readRegs(FXOS8700Q_M_OUT_X_MSB, res, 6); data.x = (res[0] << 8) | res[1]; data.y = (res[2] << 8) | res[3];