Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
You are viewing an older revision! See the latest version
ESP32 MMA7660 Programmierung
#include <Wire.h>
#include "MMA7660.h"
MMA7660 accelemeter;
void setup()
{
accelemeter.init();
Serial.begin(115200);
}
void loop() {
int8_t x;
int8_t y;
int8_t z;
float ax,ay,az;
accelemeter.getXYZ(&x,&y,&z);
accelemeter.getAcclemeter(&ax,&ay,&az);
Serial.print("gX = ");
Serial.print(ax, 3);
Serial.print("; gY = ");
Serial.print(ay, 3);
Serial.print("; gZ = ");
Serial.println(az);
Serial.println("*************");
delay(200);
}