 
   read_mpu();
 
-  Serial.print("ypr\t");
-  Serial.print(ypr[0] * 180/M_PI);
-  Serial.print("\t");
-  Serial.print(ypr[1] * 180/M_PI);
-  Serial.print("\t");
-  Serial.println(ypr[2] * 180/M_PI);
+  serial_print("ypr\t");
+  serial_print(ypr[0] * 180/M_PI);
+  serial_print("\t");
+  serial_print(ypr[1] * 180/M_PI);
+  serial_print("\t");
+  serial_println(ypr[2] * 180/M_PI);
 
 }
 

  mpu.setZGyroOffset(-85);
  mpu.setZAccelOffset(1788); // 1688 factory default for my test chip

  // make sure it worked (returns 0 if so)
  if (devStatus == 0) {
    // turn on the DMP, now that it's ready
    Serial.println(F("Enabling DMP..."));
    mpu.setDMPEnabled(true);

    // enable Arduino interrupt detection
    Serial.println(F("Enabling interrupt detection (Arduino external interrupt 0)..."));
//  attachInterrupt(0, dmpDataReady, RISING);
//  "Pin change" interrupt instead of the two hardware interrupts, already used for engine rev & wheel rev
    pinMode(PIN_INT, INPUT_PULLUP);
    attachPinChangeInterrupt(PIN_INT, dmp_data_ready, RISING);

    mpuIntStatus = mpu.getIntStatus();

    // set our DMP Ready flag so the main loop() function knows it's okay to use it
    Serial.println(F("DMP ready! Waiting for first interrupt..."));
    dmpReady = true;

    // get expected DMP packet size for later comparison

  mpuInterrupt = true;
}

unsigned int file_index = FIRST_FILE_INDEX;
const char* settings_file_name PROGMEM = "settings.ini";

void setup() {

  // join I2C bus (I2Cdev library doesn't do this automatically)
  #if I2CDEV_IMPLEMENTATION == I2CDEV_ARDUINO_WIRE
    Wire.begin(I2C_ADDRESS_ME); // Verify if it still works
    TWBR = 24; // 400kHz I2C clock (200kHz if CPU is 8MHz)
  #elif I2CDEV_IMPLEMENTATION == I2CDEV_BUILTIN_FASTWIRE
    Fastwire::setup(400, true);
  #endif
  
  Serial.begin(115200);
  while (!Serial); // wait for Leonardo enumeration, others continue immediately

  // Verify MPU connection
  serial_println(mpu.testConnection() ? "MPU6050 connection successful" : "MPU6050 connection failed");

  // load and configure the DMP
  devStatus = mpu.dmpInitialize();

  // supply your own gyro offsets here, scaled for min sensitivity
