//#include #include #include MPU6050 mpu(Wire); #include SoftwareSerial bluetooth(6, 7); // RX, TX void setup() { // set the data rate for the SoftwareSerial port bluetooth.begin(9600); Serial.begin(9600); Wire.begin(); byte status = mpu.begin(); Serial.print(F("MPU6050 status: ")); Serial.println(status); while (status != 0) { } // stop everything if could not connect to MPU6050 Serial.println(F("Calculating offsets, do not move MPU6050")); delay(1000); mpu.calcOffsets(); // gyro and accelero Serial.println("Done!\n"); } void loop() { mpu.update(); delay(50); float angley = mpu.getAngleY(); // declare the angle Y of the gyro on the variable angle float anglex = mpu.getAngleX(); // declare the angle X of the gyro on the variable angle Serial.print(angley); Serial.print(":"); Serial.println(anglex); }