   mpuInterrupt = true;
 }
 
-int file_index = FIRST_FILE_INDEX;
+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();
+    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(F("Testing device connections..."));
-  Serial.println(mpu.testConnection() ? F("MPU6050 connection successful") : F("MPU6050 connection failed"));
+  serial_println(mpu.testConnection() ? "MPU6050 connection successful" : "MPU6050 connection failed");
 
   // load and configure the DMP
-  Serial.println(F("Initializing DMP..."));
   devStatus = mpu.dmpInitialize();
 
   // supply your own gyro offsets here, scaled for min sensitivity

* - https://github.com/jrowberg/i2cdevlib/tree/master/Arduino/MPU6050
* - http://www.geekmomprojects.com/mpu-6050-redux-dmp-data-fusion-vs-complementary-filter/
* - http://42bots.com/tutorials/arduino-uno-and-the-invensense-mpu-6050-6dof-imu/
* Some useful information about Aprilia RSV/SL 1000 bikes work: (See: http://www.aprilia-v60.com/index.php?topic=262315)
* - Speed sensor: purple/green wire=Vcc ~ 9V ? / grey/white: signal ~6.5V, falling to 0V
* - Engine pulses/revolution: 3 if read from the dashboard wire
* - Engine pulses/revolution: 6 if crank shaft sensor is used
* - Wheel pulses/revolution: 5
*/

#include <SPI.h>
#include <SD.h>
//#include <WSWire.h>
#include <Wire.h>
#include <PinChangeInt.h>

#include "I2Cdev.h"
#include "MPU6050_6Axis_MotionApps20.h"

#define OUTPUT_READABLE_YAWPITCHROLL


  pinMode(10, OUTPUT);

  if (!SD.begin(chipSelect)) {
    serial_println("SD initialization failed! ");
    return;
  }

  File settings_file = SD.open(settings_file_name);
  if (settings_file) {
    char* index_ch = readline(settings_file);
    file_index = atoi(index_ch);
    file_index++;
    settings_file.close();
  }
  SD.remove(const_cast<char*>(settings_file_name));
  settings_file = SD.open(settings_file_name, FILE_WRITE);
  if (settings_file) {
    settings_file.println(file_index);
    settings_file.close();
