Pulse Detection in z-axis
Dependencies: MMA8451Q8b SLCD mbed
Fork of KL46z_single_tap_generic by
Diff: main.cpp
- Revision:
- 4:ba9ca0a0f87e
- Parent:
- 3:53d47a5dbb2c
- Child:
- 5:1fe35a74799a
--- a/main.cpp Tue Feb 03 18:05:52 2015 +0000 +++ b/main.cpp Mon Feb 09 20:05:43 2015 +0000 @@ -1,12 +1,12 @@ #include "mbed.h" -#include "MMA8451Q8.h" +#include "MMA8451Q8g.h" #include "SLCD.h" #define BLINKTIME 0.7 #define RELAYON 0 #define RELAYOFF 1 #define LEDDELAY 0.75 -#define WAITDELAY 3.0 +#define WAITDELAY 0.7 #define LCDLEN 10 #define REG_WHO_AM_I 0x0D @@ -106,7 +106,8 @@ sprintf (lcdData,"%x",regData); LCDMess(lcdData,BLINKTIME); - acc.setPulseConfiguration(latchData, axisData); // write the data + regData = latchData | axisData; + acc.setRegisterInStandby(REG_PULSE_CFG, regData); // write the data acc.readRegs(REG_PULSE_CFG, ®Data, 1); // check it sprintf (lcdData,"%x",regData); LCDMess(lcdData,BLINKTIME);