Montvydas Klumbys / Mbed 2 deprecated QuadcopterProgram

Dependencies:   MPU6050 PID Quadcopter Servo mbed

Files at this revision

API Documentation at this revision

Comitter:
moklumbys
Date:
Fri Feb 20 00:52:54 2015 +0000
Parent:
4:eb418af66d81
Child:
6:5e815d4b4d8f
Commit message:
All functions should work now.

Changed in this revision

MPU6050.lib Show annotated file Show diff for this revision Revisions of this file
Quadcopter.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/MPU6050.lib	Thu Feb 19 23:30:15 2015 +0000
+++ b/MPU6050.lib	Fri Feb 20 00:52:54 2015 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/Sissors/code/MPU6050/#898effccce30
+http://developer.mbed.org/users/moklumbys/code/MPU6050/#9b414412b09e
--- a/Quadcopter.lib	Thu Feb 19 23:30:15 2015 +0000
+++ b/Quadcopter.lib	Fri Feb 20 00:52:54 2015 +0000
@@ -1,1 +1,1 @@
-Quadcopter#84d246dccb8d
+http://developer.mbed.org/users/moklumbys/code/Quadcopter/#5ab77c583ae3
--- a/main.cpp	Thu Feb 19 23:30:15 2015 +0000
+++ b/main.cpp	Fri Feb 20 00:52:54 2015 +0000
@@ -67,7 +67,6 @@
     float gyroOffset[3];
     float angle[3];     //total calculated angle
 
-    float currTime;     //current time variable will be given in the funtion
     float prevTime;     //previous time values will be given in the function 
     
     if (mpu.testConnection())   //just testing if things are working...
@@ -108,9 +107,7 @@
 //        quad.run (speed);
 //-------------------------------------------START INFINITE LOOP-------------------------------------------------
     while(1) {
-            currTime = timer.read();                                                //get present time
-            
-            mpu.computeAngle (angle, accOffset, gyroOffset, &currTime, &prevTime);  // get angle using all these values
+            mpu.computeAngle (angle, accOffset, gyroOffset, timer.read()-prevTime);  // get angle using all these values
             
             rollPID.setInterval(timer.read()-prevTime);         //need to change the interval because don't know how much time passed
             pitchPID.setInterval(timer.read()-prevTime);