MMA845X
MMA845X
This page is to Setup and Config MMA845X
Hardware and Software
Hardware
MMA845X, Arduino or Digispark / ESP8266
Software
Arduino IDE
Sanki Notes
I2C :
SDA : A4 (Digispark D0)
SCL : A5 (Digispark D2)
SDO : GND
CS : V++
Example :https://github.com/stickbreaker/ArduinoAccelerometerDriver
Examples
This example is ..........
#include <Wire.h>
#include "Accelerometer.h"
#include "AccelerometerMMA8451.h"
AccelerometerMMA8451 acc(0);
void setup() {
Serial.begin(9600);
acc.standby();
acc.setDynamicRange(AccelerometerMMA8451::DR_4G);
acc.activate();
}
void loop() {
Serial.print("x: ");
Serial.println(acc.readXg());
Serial.print("y: ");
Serial.println(acc.readYg());
Serial.print("z: ");
Serial.println(acc.readZg());
Serial.println("-----------");
delay(1000);
}