#include
#include
#include
#include
#include
#include
float angles[3]; // yaw pitch roll
float heading;
BMP085 dps = BMP085();
long Temperature = 0, Pressure = 0, Altitude = 0;
// Set the FreeSixIMU object
FreeSixIMU sixDOF = FreeSixIMU();
HMC5883L compass;
// Record any errors that may occur in the compass.
int error = 0;
void setup(){
Serial.begin(9600);
Wire.begin();
delay(1000);
dps.init();
dps.dumpCalData();
delay(5000);
delay(5);
sixDOF.init(); //init the Acc and Gyro
delay(5);
compass = HMC5883L(); // init HMC5883
error = compass.SetScale(1.3); // Set the scale of the compass.
error = compass.SetMeasurementMode(Measurement_Continuous); // Set the measurement mode to Continuous
if(error != 0) // If there is an error, print it out.
Serial.println(compass.GetErrorText(error));
}
void loop(){
sixDOF.getEuler(angles);
Serial.print(angles[0]); //yaw
Serial.print('\t');
Serial.print(angles[1]); //pitch
Serial.print('\t');
Serial.println(angles[2]); //roll
delay(10);
}