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.
Fork of MMA8451Q by
Revision 5:bca16f119c17, committed 2015-09-10
- Comitter:
- jkolb
- Date:
- Thu Sep 10 04:30:50 2015 +0000
- Parent:
- 4:c4d879a39775
- Commit message:
- Keyboard input working, accompanied by LED illumination for now.
Changed in this revision
MMA8451Q.cpp | Show annotated file Show diff for this revision Revisions of this file |
MMA8451Q.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r c4d879a39775 -r bca16f119c17 MMA8451Q.cpp --- a/MMA8451Q.cpp Fri Oct 12 11:35:07 2012 +0000 +++ b/MMA8451Q.cpp Thu Sep 10 04:30:50 2015 +0000 @@ -40,16 +40,16 @@ return who_am_i; } -float MMA8451Q::getAccX() { - return (float(getAccAxis(REG_OUT_X_MSB))/4096.0); +int MMA8451Q::getAccX() { + return (getAccAxis(REG_OUT_X_MSB)); } -float MMA8451Q::getAccY() { - return (float(getAccAxis(REG_OUT_Y_MSB))/4096.0); +int MMA8451Q::getAccY() { + return (getAccAxis(REG_OUT_Y_MSB)); } -float MMA8451Q::getAccZ() { - return (float(getAccAxis(REG_OUT_Z_MSB))/4096.0); +int MMA8451Q::getAccZ() { + return (getAccAxis(REG_OUT_Z_MSB)); } void MMA8451Q::getAccAllAxis(float * res) {
diff -r c4d879a39775 -r bca16f119c17 MMA8451Q.h --- a/MMA8451Q.h Fri Oct 12 11:35:07 2012 +0000 +++ b/MMA8451Q.h Thu Sep 10 04:30:50 2015 +0000 @@ -75,21 +75,21 @@ * * @returns X axis acceleration */ - float getAccX(); + int getAccX(); /** * Get Y axis acceleration * * @returns Y axis acceleration */ - float getAccY(); + int getAccY(); /** * Get Z axis acceleration * * @returns Z axis acceleration */ - float getAccZ(); + int getAccZ(); /** * Get XYZ axis acceleration