A library used for controlling a quadcopter. It provides an easy to use interface, which allows to mount, calibrate and run motors. It is also able to calibrate the actual speed according to calculated PID roll & pitch difference. I used the original Servo library as ESC modules use the same PWM signal as Servo motors.
Revision 10:8147131fcebd, committed 2015-02-25
- Comitter:
- moklumbys
- Date:
- Wed Feb 25 10:42:36 2015 +0000
- Parent:
- 9:22c52af13ac2
- Commit message:
- Added getters for lower & upper calibration limits.
Changed in this revision
Quadcopter.cpp | Show annotated file Show diff for this revision Revisions of this file |
Quadcopter.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/Quadcopter.cpp Wed Feb 25 00:55:08 2015 +0000 +++ b/Quadcopter.cpp Wed Feb 25 10:42:36 2015 +0000 @@ -60,11 +60,11 @@ float Quadcopter::map(float x, float in_min, float in_max, float out_min, float out_max){ //simply maps values in the given range return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min; } - +//-------------------------------Functiuon for getting the lower calibration limit------------ float Quadcopter::getLowerLimit(){ return min_calibrate; } - +//----------------------------Function for getting upper calibration limit-------------------- float Quadcopter::getUpperLimit(){ return max_calibrate;
--- a/Quadcopter.h Wed Feb 25 00:55:08 2015 +0000 +++ b/Quadcopter.h Wed Feb 25 10:42:36 2015 +0000 @@ -81,7 +81,14 @@ */ void stabilise (float* speed, float* actSpeed, float rollDiff, float pitchDiff); + /** + * Function used to get the lower calibration limit. + */ float getLowerLimit(); + + /** + * Function used to get the upper calibration limit. + */ float getUpperLimit(); private: