Gurvan PRIEM
/
RaptorControl
An incomplete quadcopter control programme.
Diff: Utils/Utils.h
- Revision:
- 0:9cb9445a11f0
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Utils/Utils.h Wed Jul 17 15:58:25 2013 +0000 @@ -0,0 +1,24 @@ +#ifndef _UTILS_H_ +#define _UTILS_H_ + +#include "mbed.h" + +float max(float a, float b){ + if(a>b) return a; + else return b; +} + +float min(float a, float b){ + if(a<b) return a; + else return b; +} + +float clip(float m, float M, float a){ + return max(min(M,a),m); +} + +/*float abs(float a){ + return max(a,-a); +}*/ + +#endif \ No newline at end of file