Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: MPU6050 PID Quadcopter Servo mbed
Revision 5:8b3f82abe3a4, committed 2015-02-20
- 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
--- 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);