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.
Dependents: fxos8700cq_JH_explore
Fork of FXOS8700CQ by
Revision 7:e2b87c7f6c8d, committed 2016-02-05
- Comitter:
- julianhigginson
- Date:
- Fri Feb 05 01:57:41 2016 +0000
- Parent:
- 6:f79ab691a47b
- Commit message:
- adjusted 14 bit 2s compliment transform (14 bits are Left justified so need to add 4 (1<<2) after bitwise inversion)
Changed in this revision
| FXOS8700CQ.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/FXOS8700CQ.cpp Fri Feb 05 00:30:30 2016 +0000
+++ b/FXOS8700CQ.cpp Fri Feb 05 01:57:41 2016 +0000
@@ -70,13 +70,13 @@
//deal with -ve representations
if (accel_data->x && 0x8000) { //MSB is ONE
- accel_data->x = -(~(accel_data->x)+1);
+ accel_data->x = -(~(accel_data->x)+4);
}
if (accel_data->y && 0x8000) { //MSB is ONE
- accel_data->y = -(~(accel_data->y)+1);
+ accel_data->y = -(~(accel_data->y)+4);
}
if (accel_data->z && 0x8000) { //MSB is ONE
- accel_data->z = -(~(accel_data->z)+1);
+ accel_data->z = -(~(accel_data->z)+4);
}
// scale back down to actual 14 bit number
