Midterm defines.
Dependencies: MMA8451Q8b SLCD mbed
Fork of KL46z_single_tap_2017_blank by
Revision 13:d7cfc3110df9, committed 2017-03-13
- Comitter:
- mturner5
- Date:
- Mon Mar 13 10:11:22 2017 +0000
- Parent:
- 12:10e6d0d12833
- Commit message:
- midterm
Changed in this revision
KL46z_single_tap_2017.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 10e6d0d12833 -r d7cfc3110df9 KL46z_single_tap_2017.cpp --- a/KL46z_single_tap_2017.cpp Thu Mar 09 02:37:39 2017 +0000 +++ b/KL46z_single_tap_2017.cpp Mon Mar 13 10:11:22 2017 +0000 @@ -29,14 +29,18 @@ You need to fill nn the missing numbers below for this to work 0x00 is just a place holder *************************************/ -#define LATCH_DATA 0x00 // for use in REG_PULSE_CFG -#define AXIS_DATA 0x00 -#define SET_INTERRUPT 0x00 //using interrupt INT1 PTC5 -#define SET_INT_LINE 0x00 +#define LATCH_DATA 0x40 // for use in REG_PULSE_CFG +#define AXIS_DATA 0x10 +#define SET_INTERRUPT 0x08 //looks like step 1 for setting interrupts. //Initialy thought this was 0x2E, + //but after seeing the process for setting interrupts, it looks like it is a + //1,2 process, so thus 0x08 seems like the first step and then 0x08, the second + //but again, is just a theory. + +#define SET_INT_LINE 0x08 //looks like step 2 -#define SET_THZ 0x00 // See Table 49 in data sheet +#define SET_THZ 0x02 // See Table 49 in data sheet //0x2A seems like the most logical hex to use. -#define SET_TMLT 0x00 // See Table 51 in data sheet +#define SET_TMLT 0x0F // See Table 51 in data sheet //0x0F is 15 ms I think /*********************************************************/ //#define PRINTDBUG @@ -54,7 +58,7 @@ #define MMA8451_I2C_ADDRESS (0x1d<<1) Ticker ledBlink; // timinginterrupt for RED led -InterruptIn MMA8451QInt1(PTC5); //push botton with internal pullup +InterruptIn MMA8451QInt1(PTC5); //push botton with internal pullup <<- already set? //InterruptIn MMA8451QInt1(PTD1); DigitalOut myled(LED_RED); // red led DigitalOut relay(LED_GREEN); // green led @@ -125,7 +129,7 @@ LCDMess(lcdData,BLINKTIME); // Check to see if accerlometer is alive and well - acc.setGLimit(MAX_4G); // For now set to 2g + acc.setGLimit(MAX_2G); //this is set to 2g. acc.readRegs(XYZ_DATA_CFG, ®Data, 1); sprintf (lcdData,"%x",regData); // Note displaying in hexidecimal LCDMess(lcdData,BLINKTIME);