NOT FINISHED YET!!! My first try to get a self built fully working Quadrocopter based on an mbed, a self built frame and some other more or less cheap parts.
Diff: main.cpp
- Revision:
- 9:4e0c3936c756
- Parent:
- 8:d25ecdcdbeb5
- Child:
- 10:953afcbcebfc
--- a/main.cpp Mon Oct 15 19:03:17 2012 +0000 +++ b/main.cpp Tue Oct 16 10:21:32 2012 +0000 @@ -57,7 +57,7 @@ angle[0] += (Acc_angle[0] - angle[0])/50 + Gyro_data[0] *dt/15000000.0; angle[1] += (Acc_angle[1] - angle[1])/50 + Gyro_data[1] *dt/15000000.0; tempangle += (Comp_angle - tempangle)/50 - Gyro_data[2] *dt/15000000.0; - angle[2] -= Gyro_data[2] *dt/15000000.0; + angle[2] -= Gyro_data[2] *dt/15000000.0; // gyro only here // Read RC data //RC[0].read() // TODO: RC daten lesen und einberechnen! @@ -72,20 +72,11 @@ pc.printf("Flybed v0.2"); LEDs.roll(2); - //Kompass kalibrieren --> Problem fremde Magnetfelder! - //Comp.AutoCalibration = 1; - short MagRawMin[3]= {-400, -400, -400}; //Gespeicherte Werte verwenden - short MagRawMax[3]= {400, 400, 400}; - Comp.Calibrate(MagRawMin, MagRawMax); - //Comp.Calibrate(20); - - Alt.oss = 0; //Oversampling des Barometers setzen - + // Start! GlobalTimer.start(); Datagetter.attach(&get_Data, 0.02); // start to get data all 10ms while(1) { - // PC output - pc.locate(10,5); + pc.locate(10,5); // PC output pc.printf("dt:%dms %6.1fm ", dt/1000, Alt.CalcAltitude(Alt.Pressure)); pc.locate(10,8); pc.printf("Roll:%6.1f Pitch:%6.1f Yaw:%6.1f ", angle[0], angle[1], angle[2]);