The whole program

Dependencies:   MMA8451Q8_v2 SLCD mbed

Fork of KL46z_single_tap_Project_1_v1 by Bresdin O'Malley

Files at this revision

API Documentation at this revision

Comitter:
bomalley
Date:
Mon Feb 16 03:40:03 2015 +0000
Parent:
5:0930b17d337d
Commit message:
Project v2

Changed in this revision

MMA8451Q8.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/MMA8451Q8.lib	Mon Feb 16 03:23:33 2015 +0000
+++ b/MMA8451Q8.lib	Mon Feb 16 03:40:03 2015 +0000
@@ -1,1 +1,1 @@
-http://developer.mbed.org/users/bomalley/code/MMA8451Q8_v1/#a3c651c98243
+http://developer.mbed.org/users/bomalley/code/MMA8451Q8_v2/#f249e23a8514
--- a/main.cpp	Mon Feb 16 03:23:33 2015 +0000
+++ b/main.cpp	Mon Feb 16 03:40:03 2015 +0000
@@ -18,16 +18,16 @@
 #define REG_PULSE_SRC     0x22
 #define REG_PULSE_CFG     0x21
 
-#define REG_PULSE_THSZ    0x25
+#define REG_PULSE_THSZ    0x25 //Acctivated interupt
 #define REG_PULSE_TMLT    0x26
 #define REG_PULSE_LTCY    0x27
 
 #define REG_CTRL_REG4   0x2D
 #define REG_CTRL_REG5   0x2E
 
-#define REG_DATA_THSZ    0x08
-#define REG_DATA_TMLT    0x26
-#define REG_DATA_LTCY    0x27
+#define REG_DATA_THSZ   0x08
+#define REG_DATA_TMLT   0x50 // Set the time limit for the Tap Detection to 50ms, Normal Mode
+#define REG_DATA_LTCY   0xF0 // Set the latency time to 300ms
 
 #define MAX_2G            0x00
 #define MAX_4G            0x01
@@ -123,13 +123,20 @@
         sprintf (lcdData,"%x",regData);
         LCDMess(lcdData,BLINKTIME); 
         
-        //send address 
+        //send address for teh z axis -->
         acc.setRegisterInStandby(REG_PULSE_THSZ, REG_DATA_THSZ);
+        
+        //pulse time limit -->
         acc.setRegisterInStandby(REG_PULSE_TMLT, REG_DATA_TMLT);
+        
+        // latency time limit -->
         acc.setRegisterInStandby(REG_PULSE_LTCY, REG_DATA_LTCY);
         
-        acc.setRegisterInStandby(REG_CTRL_REG4, 0x08);
-        acc.setRegisterInStandby(REG_CTRL_REG5, 0x08);
+        //interrupt bit 3 pulse interrupt -->
+        acc.setRegisterInStandby(REG_CTRL_REG4, 0x08);  
+        
+        //interrupt bit 3 int1 pin -->
+        acc.setRegisterInStandby(REG_CTRL_REG5, 0x08); 
 
         acc.readRegs(REG_PULSE_SRC, &regData, 1);
         sprintf (lcdData,"%x",regData);