Updates and more comments Solution to Ambient Midterm 2017

Dependencies:   MMA8451Q8b SLCD mbed

Files at this revision

API Documentation at this revision

Comitter:
scohennm
Date:
Tue Mar 14 16:42:14 2017 +0000
Parent:
11:c842619c49a1
Commit message:
solution to Midterm ambient Sp2017

Changed in this revision

KL46z_single_tap_2016..cpp Show annotated file Show diff for this revision Revisions of this file
diff -r c842619c49a1 -r 4774c4fc718e KL46z_single_tap_2016..cpp
--- a/KL46z_single_tap_2016..cpp	Mon Feb 22 16:56:38 2016 +0000
+++ b/KL46z_single_tap_2016..cpp	Tue Mar 14 16:42:14 2017 +0000
@@ -2,7 +2,7 @@
 #include "MMA8451Q8g.h"
 #include "SLCD.h"
 
-#define BLINKTIME   0.2
+#define BLINKTIME   1.5
 #define RELAYON     0
 #define RELAYOFF    1
 #define LEDDELAY    0.4
@@ -27,14 +27,14 @@
 #define MAX_8G            0x02
 #define SET_INTERRUPT     0x08 //using interrupt INT1 PTC5
 #define SET_INT_LINE      0x08
-//#define SET_INTERRUPT     0x00 //using interrupt INT2 PTD1
-//#define SET_INT_LINE      0x00
 #define SET_THZ           0x20 //  See Table 49 in data sheet
 /***********
+0b0010 0000
 2g/0.063g/count = 32 counts
 ************/
 #define SET_TMLT          0x18 // See Talbe 51 in data sheet
 /******
+0b0001 1000
 24 = 0x18
 time step at 800Hz ODR = 0.625ms
 24x0.625 = 15 ms
@@ -56,7 +56,6 @@
  
 Ticker ledBlink; // timinginterrupt for RED led
 InterruptIn MMA8451QInt1(PTC5);  //push botton with internal pullup
-//InterruptIn MMA8451QInt1(PTD1);
 DigitalOut myled(LED_RED); // red led
 DigitalOut relay(LED_GREEN); // green led