Pulse Detection in z-axis
Dependencies: MMA8451Q8b SLCD mbed
Diff: main.cpp
- Revision:
- 8:ef41bb84f1cc
- Parent:
- 7:8e0a51092728
- Child:
- 9:08acb96591a8
--- a/main.cpp Mon Feb 16 19:23:59 2015 +0000 +++ b/main.cpp Mon Feb 16 19:49:09 2015 +0000 @@ -9,7 +9,6 @@ #define WAITDELAY 0.7 #define LCDLEN 10 - #define REG_WHO_AM_I 0x0D #define XYZ_DATA_CFG 0x0E @@ -87,8 +86,8 @@ uint8_t regData = MAX_4G; uint8_t latchData = 0x40; //0b01000000; //for pulse config register uint8_t axisData = 0x10; //0b00010000; - uint8_t interrupt1Data = 0x08; //0b00001000; - uint8_t interrupt2Data = 0x04; //0b00000100; + uint8_t interrupt1EnableData = 0x08; //0b00001000; + uint8_t interrupt1SetData = 0x04; //0b00000100; char lcdData[LCDLEN]; myled.write(outState); @@ -113,10 +112,10 @@ // Set up (pulse) interrupt to INT1 pin - regData = interrupt1Data; - acc.setRegisterInStandby(REG_CTRL_4, regData); // write the data - regData = interrupt2Data; - acc.setRegisterInStandby(REG_CTRL_5, regData); // write the data + regData = interrupt1EnableData; + acc.setRegisterInStandby(REG_CTRL_4, regData); // write the data + regData = interrupt1SetData; + acc.setRegisterInStandby(REG_CTRL_5, regData); // write the data while (true) {