Dependents: nhk_2018_undercarry_test04 nhk_2018_undercarry_test08 nhk_2018_undercarry_test09 nhk_2018_undercarry_test10 ... more
Diff: PID.h
- Revision:
- 0:d8b5fa590ca2
- Child:
- 3:3bc8034f569e
diff -r 000000000000 -r d8b5fa590ca2 PID.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/PID.h Tue Jan 16 14:27:31 2018 +0000 @@ -0,0 +1,25 @@ +#ifndef PID_H +#define PID_H + +#include "mbed.h" + +class PID { +private: + Timer timer; + double Setpoint; + double KP; + double KI; + double KD; + unsigned long dt; + unsigned long preTime; + double P; + double I; + double D; + double preP; +public: + PID(double,double,double,double); + void init(); + double compute(double); +}; + +#endif \ No newline at end of file