MMA8452Q, 3-axis, 12-bit/8-bit digital accelerometer library. Developed by aconno dev team. For example program with the library, contact us.
Dependents: acd52832_BLE_VF_GeoBeacon
Diff: mma8452.h
- Revision:
- 1:bda670d7a481
- Parent:
- 0:65b19bf1382a
- Child:
- 2:ba3e65007adf
diff -r 65b19bf1382a -r bda670d7a481 mma8452.h --- a/mma8452.h Sun Jul 02 16:04:27 2017 +0000 +++ b/mma8452.h Wed Jul 19 12:07:14 2017 +0000 @@ -10,9 +10,9 @@ #define SA0 1 #if SA0 - #define MMA8452_ADDRESS 0x1D // SA0 is high, 0x1C if low - + #define MMA8452_ADDRESS (0x1D << 1) // SA0 is high, 0x1C if low. Shifting address by 1 bit as i2c is a 7 bit encoding, and this is 8bit encoded #else - #define MMA8452_ADDRESS 0x1C + #define MMA8452_ADDRESS (0x1C << 1) // SA0 is high, 0x1C if low. Shifting address by 1 bit as i2c is a 7 bit encoding, and this is 8bit encoded #endif #define STATUS 0x00 // Type 'read' : Real time status, should return 0x00