Skip to content

Instantly share code, notes, and snippets.

@costyn
Created June 15, 2020 13:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save costyn/e52fd7a7ac0043b09e89e673ad484ecb to your computer and use it in GitHub Desktop.
Save costyn/e52fd7a7ac0043b09e89e673ad484ecb to your computer and use it in GitHub Desktop.
#include <stdint.h>
#include <Arduino.h>
#include "MPU6886.h"
static MPU6886 mpu;
void setup(void)
{
Serial.begin(115200);
mpu.Init();
}
void loop(void)
{
float x, y, z;
float pitch,roll,yaw;
mpu.getAccelData(&x, &y, &z);
mpu.getAhrsData(&pitch, &roll, &yaw);
Serial.printf("accel: %f.6\t%f.6\t%f.6\n", &x, &y, &z);
Serial.printf("pitch: %.6f\t roll %.6f\t yaw %.6f\n", &pitch, &roll, &yaw);
delay(100);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment