Pulse Detection in z-axis
Dependencies: MMA8451Q8b SLCD mbed
Fork of KL46z_single_tap_generic by
Revision 12:025808f5dc44, committed 2015-02-18
- Comitter:
- vbharam
- Date:
- Wed Feb 18 20:03:34 2015 +0000
- Parent:
- 11:adb9adf636cf
- Commit message:
- WORKING;
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r adb9adf636cf -r 025808f5dc44 main.cpp --- a/main.cpp Tue Feb 17 03:52:51 2015 +0000 +++ b/main.cpp Wed Feb 18 20:03:34 2015 +0000 @@ -18,6 +18,7 @@ #define REG_PULSE_CFG 0x21 #define REG_PULSE_SRC 0x22 #define REG_PULSE_THSZ 0x25 +#define REG_PULSE_TMLT 0x26 #define REG_CTRL_4 0x2D #define REG_CTRL_5 0x2E @@ -26,6 +27,8 @@ #define MAX_8G 0x02 #define SET_INTERRUPT 0x08 #define SET_INT_LINE 0x08 +#define SET_THZ 0x20 +#define SET_TMLT 0x18 //#define PRINTDBUG @@ -106,6 +109,10 @@ sprintf (lcdData,"%x",regData); // Note displaying in hexidecimal LCDMess(lcdData,BLINKTIME); +// Set up (pulse) PARAMETERS + acc.setRegisterInStandby(REG_PULSE_THSZ, SET_THZ); // write the data + acc.setRegisterInStandby(REG_PULSE_TMLT, SET_TMLT); // write the data + // Set up (pulse) interrupt to INT1 pin acc.setRegisterInStandby(REG_CTRL_4, SET_INTERRUPT); // write the data acc.setRegisterInStandby(REG_CTRL_5, SET_INT_LINE); // write the data