#include <Wire.h>
//#include <MPU6050.h>
#include <Adafruit_MPU6050.h>
void check_settings();
Adafruit_MPU6050 mpu;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Initialize MPU6050");
while(!mpu.begin())
{
Serial.println("Could not find a valid MPU6050 sensor - check wiring");
delay(500);
}
}
void loop() {
// put your main code here, to run repeatedly:
sensors_event_t accel, gyro, temp;
mpu.getEvent(&accel, &gyro, &temp);
Serial.print(" Xraw = ");
Serial.print(accel.acceleration.x);
Serial.print(" Yraw = ");
Serial.print(accel.acceleration.y);
Serial.print(" Zraw = ");
Serial.println(accel.acceleration.z);
Serial.print(" Xnorm = ");
Serial.print(gyro.gyro.roll);
Serial.print(" Ynorm = ");
Serial.print(gyro.gyro.pitch);
Serial.print(" Znorm = ");
Serial.println(gyro.gyro.heading);
delay(10);
}