An fully working IMU-Filter and Sensor drivers for the 10DOF-Board over I2C. All in one simple class. Include, calibrate sensors, call read, get angles. (3D Visualisation code for Python also included) Sensors: L3G4200D, ADXL345, HMC5883, BMP085

Dependencies:   mbed

Revision:
4:f62337b907e5
Parent:
3:6dbefedce7fe
--- a/main.cpp	Tue Aug 27 22:18:25 2013 +0000
+++ b/main.cpp	Thu Aug 29 13:52:30 2013 +0000
@@ -12,7 +12,7 @@
 Ticker Dutycycler;                      // timecontrolled interrupt for exact timed control loop
 
 void dutycycle() { // method which is called by the Ticker Dutycycler every RATE seconds
-    IMU.read();
+    IMU.readAngles();
 }
 
 void executer() {
@@ -24,9 +24,12 @@
     Dutycycler.attach(&dutycycle, RATE);     // start to process all RATE seconds
     pc.attach(&executer);
     while(1) {
+        #warning The current version has some hardcoded calibration values, change them in order to get high precision, to find them look out for_ warnings (sorry for_ that hope to get time to develop autocalibration)
         // just putting out the angle on console
-        pc.printf("%f,%f,%f,%3.5fs,%3.5fs\r\n", IMU.angle[0], IMU.angle[1], IMU.angle[2], IMU.dt, IMU.dt_sensors); // Output for Python
-        wait(0.01);
+        IMU.readAltitude(); // reading altitude takes much more time than the angles -> don't do this in your fast loop
+        pc.printf("%.1f,%.1f,%.1f,%.1f'C,%.1fhPa,%.1fmaS,%.5fs,%.5fs\r\n", IMU.angle[0], IMU.angle[1], IMU.angle[2], IMU.temperature, IMU.pressure, IMU.altitude, IMU.dt, IMU.dt_sensors); // Output for Python
+        
+        wait(0.01); // this is to avoid buffer overflow in the Computers UART-Controller
 
         LEDs.tilt(1);
     }