A basic library for the MMA8652 accelerometer, provides data in either floating point G's or as a signed 16 bit integer.

Dependents:   microbit_mouse_BLE_daybreak_version

Fork of MMA8652 by Jim Carver

Files at this revision

API Documentation at this revision

Comitter:
suntopbd
Date:
Sun May 27 17:17:26 2018 +0000
Parent:
2:29c2dd97ca95
Commit message:
ver 0.0.3 beta Accel ok, mouse pair ok, mouse movement and buttons not functional yet

Changed in this revision

MMA8652.h Show annotated file Show diff for this revision Revisions of this file
--- a/MMA8652.h	Mon Jun 02 18:22:59 2014 +0000
+++ b/MMA8652.h	Sun May 27 17:17:26 2018 +0000
@@ -20,21 +20,17 @@
 #define MMA8652_H
 
 #include "mbed.h"
-
-
 // MMA8652 Slave Address
 #define MMA8652_SLAVE_ADDR 0x3A
-
-// MMA8652 internal register addresses
+// MMA8653 internal register addresses
 #define MMA8652_STATUS 0x00
 #define MMA8652_OUT_X_MSB 0x01
 #define MMA8652_WHOAMI 0x0D
 #define MMA8652_XYZ_DATA_CFG 0x0E
-#define MMA8652_CTRL_REG1 0x2A
+#define MMA8652_CTRL_REG1 0x00
 #define MMA8652_WHOAMI_VAL 0x4A
-
 /**
- * MMA8652 Xtrinsic accelerometer on I2C
+ * MMA865 Xtrinsic accelerometer on I2C
  */
 class MMA8652
 {