Midterm

Dependencies:   MMA8451Q8b SLCD mbed

Fork of KL46z_double_tap_2017 by Mark Turner

Revision:
13:254e382efeab
Parent:
12:4774c4fc718e
Child:
14:ca20f659409a
--- a/KL46z_single_tap_2016..cpp	Tue Mar 14 16:42:14 2017 +0000
+++ b/KL46z_single_tap_2016..cpp	Wed Mar 15 07:04:12 2017 +0000
@@ -25,14 +25,14 @@
 #define MAX_2G            0x00
 #define MAX_4G            0x01
 #define MAX_8G            0x02
-#define SET_INTERRUPT     0x08 //using interrupt INT1 PTC5
-#define SET_INT_LINE      0x08
-#define SET_THZ           0x20 //  See Table 49 in data sheet
+#define SET_INTERRUPT     0x00 //using interrupt INT1 PTC5
+#define SET_INT_LINE      0x00
+#define SET_THZ           0x28 //  See Table 49 in data sheet
 /***********
 0b0010 0000
 2g/0.063g/count = 32 counts
 ************/
-#define SET_TMLT          0x18 // See Talbe 51 in data sheet
+#define SET_TMLT          0x38 // See Talbe 51 in data sheet
 /******
 0b0001 1000
 24 = 0x18
@@ -55,7 +55,7 @@
 #define MMA8451_I2C_ADDRESS (0x1d<<1)
  
 Ticker ledBlink; // timinginterrupt for RED led
-InterruptIn MMA8451QInt1(PTC5);  //push botton with internal pullup
+InterruptIn MMA8451QInt1(PTD1);  //push botton with internal pullup
 DigitalOut myled(LED_RED); // red led
 DigitalOut relay(LED_GREEN); // green led
 
@@ -95,8 +95,10 @@
 
 // end interrupt routines
 
+
 int main()
 {
+    
     uint8_t regData; 
     uint8_t latchData = 0x40; //0b01000000; //for pulse config register
     uint8_t axisData = 0x10; //0b00010000;