#include <Adafruit_MPU6050.h>
#include <Adafruit_Sensor.h>
#include <Wire.h>
#include <Stepper.h>
const int stepsPerRevolution = 2048; // change this to fit the number of steps per revolution
// ULN2003 Motor Driver Pins
#define IN1 19
#define IN2 18
#define IN3 5
#define IN4 17
Adafruit_MPU6050 m_p_u;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
while(!Serial);
delay(20);
if(!m_p_u.begin())
{
while(1)
{
delay(20);
}
}
}
void loop() {
// put your main code here, to run repeatedly:
sensors_event_t acc,gcc,temp;
m_p_u.getEvent(&acc,&gcc,&temp);
Serial.println("Acceleration on x aaxes:");
Serial.println(acc.acceleration.x);
Serial.println("Acceleration on y aaxes:");
Serial.println(acc.acceleration.y);
Serial.println("Rotation on x axes:");
Serial.println(gcc.acceleration.x);
delay(10); // this speeds up the simulation
}