Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: MotionSensor
Fork of FXOS8700Q by
Revision 7:c53dda05b8cf, committed 2014-04-25
- Comitter:
- JimCarver
- Date:
- Fri Apr 25 16:45:51 2014 +0000
- Parent:
- 6:cdc362f08339
- Child:
- 8:52116f8fb3da
- Commit message:
- Version 1.0 using MotionSensor virtual class
Changed in this revision
| FXOS8700Q.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- 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];
