Project 1 V1 Submission
Fork of MMA8451Q8_v1 by
Diff: MMA8451Q8.cpp
- Revision:
- 10:a3c651c98243
- Parent:
- 9:84011f06d1ea
- Child:
- 11:f249e23a8514
diff -r 84011f06d1ea -r a3c651c98243 MMA8451Q8.cpp --- 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]); }