Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: MMA8451Q8b SLCD mbed
Fork of KL46z_single_tap_2017_blank by
Revision 9:08acb96591a8, committed 2015-02-16
- Comitter:
- vbharam
- Date:
- Mon Feb 16 20:06:22 2015 +0000
- Parent:
- 8:ef41bb84f1cc
- Child:
- 10:c7ac4fd52536
- Commit message:
- change in tap;
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Mon Feb 16 19:49:09 2015 +0000
+++ b/main.cpp Mon Feb 16 20:06:22 2015 +0000
@@ -86,8 +86,7 @@
uint8_t regData = MAX_4G;
uint8_t latchData = 0x40; //0b01000000; //for pulse config register
uint8_t axisData = 0x10; //0b00010000;
- uint8_t interrupt1EnableData = 0x08; //0b00001000;
- uint8_t interrupt1SetData = 0x04; //0b00000100;
+
char lcdData[LCDLEN];
myled.write(outState);
@@ -95,7 +94,7 @@
// set up interrrupts to be used later for taps
MMA8451QInt1.rise(&GreenLEDBlinker);
- MMA8451QInt1.mode(PullNone);
+ MMA8451QInt1.mode(PullNone);
// set up interrrupts to be used later for taps
// mybutton.fall(&pressed);
@@ -106,17 +105,16 @@
acc.readRegs(XYZ_DATA_CFG, ®Data, 1);
sprintf (lcdData,"%x",regData); // Note displaying in hexidecimal
LCDMess(lcdData,BLINKTIME);
+
+// 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
+
acc.readRegs(REG_WHO_AM_I, ®Data, 1);
sprintf (lcdData,"%x",regData);
LCDMess(lcdData,BLINKTIME);
-// Set up (pulse) interrupt to INT1 pin
- regData = interrupt1EnableData;
- acc.setRegisterInStandby(REG_CTRL_4, regData); // write the data
- regData = interrupt1SetData;
- acc.setRegisterInStandby(REG_CTRL_5, regData); // write the data
-
while (true) {
// Read Pulse Source Data and check to see if things have been set
