biblioteka dla akcelerometru
Fork of MMA8451Q by
Revision 5:be673a941b0f, committed 2017-01-13
- Comitter:
- marcus255
- Date:
- Fri Jan 13 01:10:28 2017 +0000
- Parent:
- 4:c4d879a39775
- Commit message:
- Initial version;
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 be673a941b0f MMA8451Q.cpp --- a/MMA8451Q.cpp Fri Oct 12 11:35:07 2012 +0000 +++ b/MMA8451Q.cpp Fri Jan 13 01:10:28 2017 +0000 @@ -52,6 +52,18 @@ return (float(getAccAxis(REG_OUT_Z_MSB))/4096.0); } +int MMA8451Q::getUnsignedX() { + return getAccAxis(REG_OUT_X_MSB); +} + +int MMA8451Q::getUnsignedY() { + return getAccAxis(REG_OUT_Y_MSB); +} + +int MMA8451Q::getUnsignedZ() { + return getAccAxis(REG_OUT_Z_MSB); +} + void MMA8451Q::getAccAllAxis(float * res) { res[0] = getAccX(); res[1] = getAccY();
diff -r c4d879a39775 -r be673a941b0f MMA8451Q.h --- a/MMA8451Q.h Fri Oct 12 11:35:07 2012 +0000 +++ b/MMA8451Q.h Fri Jan 13 01:10:28 2017 +0000 @@ -89,7 +89,15 @@ * * @returns Z axis acceleration */ - float getAccZ(); + float getAccZ(); + + int getUnsignedX(); + + int getUnsignedY(); + + int getUnsignedZ(); + + /** * Get XYZ axis acceleration