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 MMA8451Q8 by
Revision 10:a3c651c98243, committed 2015-02-16
- Comitter:
- bomalley
- Date:
- Mon Feb 16 03:22:28 2015 +0000
- Parent:
- 9:84011f06d1ea
- Commit message:
- Project 1 V1
Changed in this revision
MMA8451Q8.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/MMA8451Q8.cpp Mon Feb 09 06:57:21 2015 +0000 +++ b/MMA8451Q8.cpp Mon Feb 16 03:22:28 2015 +0000 @@ -30,6 +30,14 @@ #define REG_PULSE_SRC 0x22 #define REG_PULSE_CFG 0x21 +#define REG_PULSE_THSZ 0x25 +#define REG_PULSE_TMLT 0x26 +#define REG_PULSE_LTCY 0x27 + +/*#define REG_DATA_THSZ 0x25 +#define REG_DATA_TMLT 0x26 +#define REG_DATA_LTCY 0x27*/ + #define UINT14_MAX 16383 #define MAX_2G 0x00 @@ -82,6 +90,7 @@ data[DATA_INDEX] = 0x01; writeRegs(data, 2); // make active } + void MMA8451Q::setRegisterInStandby(uint8_t regAddress, uint8_t regData) { uint8_t configBits; uint8_t data[NUM_DATA] = {REG_CTRL_REG_1, 0x00}; // put in standby mode @@ -95,6 +104,7 @@ data[DATA_INDEX] = 0x01; writeRegs(data, 2); // make active } + float MMA8451Q::getAccX() { return (float(getAccAxis(REG_OUT_X_MSB))/gScaling[gChosen]); }