             newMagn.scalar[i] *= -1;
         }
     }
+/*
+    Serial.println();
+    for(int j=0; j<6; j++){
+        float data[3];
+        for(int i=0; i<3; i++) data[i] = magnLog[j][i];
+        newMagn.calibrate(data);
+        float val = data[j/2] * ((j%2)? 1.0 : -1.0);
+        Serial.print(j/2);
+        Serial.print("\t");
+        Serial.print(val);
+        Serial.print("\t");
+        Serial.println();
+    }
+*/
 
     Serial.println("res = (raw+shift)*scalar");
     Serial.println("New accelerometer tune:");

#include "Wire.h"
#include "SPI.h"
#include "MINDS-i-Drone.h"
#include "platforms/Ardupilot.h"
using namespace Platform;

enum ProgramState {
    COLLECT_STATES,

float acclLog[6][3];
float magnLog[6][3];

MPU6000  mpu;
HMC5883L cmp;
InertialVec* sens[2] = {&mpu, &cmp};
Translator   conv[2] = {Translators::identity, Translators::identity};
InertialManager sensors(sens, conv, 2);
Settings set(eeStorage::getInstance());

class datastream{
private:
