# include "MPU6050.h"
# include "Wire.h"
MPU6050 accel;
unsigned long tNow, tStart;
int16_t ax, ay, az;
int16_t gx, gy, gz;
int sampTime = 1000;
void setup() {
// put your setup code here, to run once:
Serial.begin(38400);
Wire.begin();
accel.initialize();
//accel.CalibrateAccel(6);
}
void loop() {
// put your main code here, to run repeatedly:
tNow = millis();
if ((tNow - tStart) >= sampTime){
accel.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);
Serial.println(ax);
tStart = tNow;
}
}