     eepromRW(EEPROM_IMU_INTERVAL, IMU_INTERVAL, imuInterval, action, time);
 }
 
+void getIMU()
+{
+    // get the accel (m/s/s), gyro (rad/s), and magnetometer (uT), and temperature (C) data
+    IMU.getMotion10(d);
+    count++;
+}
+
 void imuLoop(unsigned long time, int mode)
 {
     static unsigned long next;
+    float d2[10];
 
     // is it this time to read IMU
-    if (next < time)
+    if (next < time )
     {
         // set up next ping time
-        next = time + imuInterval;
+        //next = time + imuInterval;
+        next = time + 2;
 
         // get the accel (m/s/s), gyro (rad/s), and magnetometer (uT), and temperature (C) data
-        IMU.getMotion10Unbiased(d);
+        //IMU.getMotion10Unbiased(d);
+        
 
         // Sensors x (y)-axis of the accelerometer/gyro is aligned with the y (x)-axis of the magnetometer;
         // the magnetometer z-axis (+ down) is misaligned with z-axis (+ up) of accelerometer and gyro!


// an MPU9250 object with its I2C address
// of 0x68 (ADDR to GRND) and on Teensy 3.5 bus 0
MPU9250 IMU(0x68, 0, I2C_PINS_18_19, I2C_PULLUP_EXT);

float q[4] = {1.0f, 0.0f, 0.0f, 0.0f};
float d[10];

static int imuInterval = IMU_INTERVAL;


    };

    IMU.setBias(b);

    status = IMU.setFilter(DLPF_BANDWIDTH_184HZ, 9);
    if (status < 0) 
    {
        setupFail("IMU INT unsuccessful");
    }
    pinMode(IMU_INT_PIN, INPUT);
    attachInterrupt(IMU_INT_PIN, getIMU, RISING);    
}

void imuEeprom(int action, const unsigned long time)
