The MMA7660FC is a digital output I²C, very low-power, low-profile capacitive micro-machined accelerometer featuring a low pass filter, compensation for zero-g offset and gain errors and conversion to six-bit digital values at a user configurable output data rate. The device can be used for sensor data changes, product orientation and gesture detection through an interrupt pin (INT).
Communication is handled through a 2 pin I2C interface, available on a wide range of microcontrollers. The I2C address by default is 0x4c.
Features
Connection
Module connection to Microbit
- GND = GND
- VCC = 3v3
- SDA = 20
- SCL = 21
Code
I used this library – https://github.com/mcauser/Grove-3Axis-Digital-Accelerometer-1.5g-MMA7660FC
This is the default example
[codesyntax lang=”cpp”]
#include <Wire.h>
#include “MMA7660.h”
MMA7660 acc;
void setup()
{
acc.init();
Serial.begin(115200);
}
void loop()
{
static long cnt = 0;
static long cntout = 0;
float ax,ay,az;
int8_t x, y, z;
acc.getXYZ(&x,&y,&z);
if(acc.getAcceleration(&ax,&ay,&az))
{
Serial.print(“got data ok: “);
}
else
{
Serial.print(“timed out: “);
}
Serial.println(“acceleration of X/Y/Z: “);
Serial.print(ax);
Serial.println(” g”);
Serial.print(ay);
Serial.println(” g”);
Serial.print(az);
Serial.println(” g”);
Serial.println();
delay(500);
}
[/codesyntax]
Output
Open the serial monitor
got data ok: acceleration of X/Y/Z:
2.76 g
0.19 g
2.33 g
got data ok: acceleration of X/Y/Z:
1.48 g
1.48 g
1.52 g
got data ok: acceleration of X/Y/Z:
2.62 g
0.00 g
0.48 g
got data ok: acceleration of X/Y/Z:
2.90 g
0.81 g
2.43 g
Link
https://www.nxp.com/docs/en/data-sheet/MMA7660FC.pdf
1PCS NEW MMA7660 Replace MMA7260 3 Axis Triaxial accelerometer sensor module