accelerometer library
Fork of MMA8452Q by
Diff: MMA8452Q.h
- Revision:
- 1:a63e41016132
- Parent:
- 0:b3305e3c9e73
--- a/MMA8452Q.h Thu Oct 19 12:53:02 2017 +0000 +++ b/MMA8452Q.h Thu Dec 07 15:23:07 2017 +0000 @@ -17,6 +17,12 @@ #define REG_WHO_AM_I 0x0D #define REG_XYZ_DATA_CFG 0x0E #define REG_CTRL_REG1 0x2A +#define REG_CTRL_REG4 0X2D +#define FF_CONFIG 0X15 +#define FF_THS 0X17 +#define FF_COUNT 0X18 +#define FF_SRC 0X16 +#define REG_CTRL_REG5 0X2E // WHO_AM_I check #define FACTORY_ID 0x2A @@ -39,6 +45,8 @@ // Init values #define DEFAULT_FSR SCALE_2G #define DEFAULT_ODR ODR_800HZ +#define DEFAULT_PIN 0X04 +#define DEFAULT_THRESH 0x03 // Class declaration @@ -53,6 +61,7 @@ void setODR(uint8_t odr); void standby(); void active(); + void freefall(uint8_t interrupt,uint8_t threshold); float readX(); float readY(); float readZ();