Proportional, integral, derivative controller library. Ported from the Arduino PID library by Brett Beauregard.
Fork of PID by
Revision 1:b1c9d8d482cb, committed 2016-07-05
- Comitter:
- eisd
- Date:
- Tue Jul 05 11:55:15 2016 +0000
- Parent:
- 0:6e12a3e5af19
- Commit message:
- mbed style get/set for set point
Changed in this revision
PID.cpp | Show annotated file Show diff for this revision Revisions of this file |
PID.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r 6e12a3e5af19 -r b1c9d8d482cb PID.cpp --- a/PID.cpp Thu Sep 02 16:48:10 2010 +0000 +++ b/PID.cpp Tue Jul 05 11:55:15 2016 +0000 @@ -322,3 +322,12 @@ return dParam_; } + +PID::operator float() { + return setPoint_; +} + +PID& PID::operator=(float sp) { + setPoint_ = sp; + return *this; +}
diff -r 6e12a3e5af19 -r b1c9d8d482cb PID.h --- a/PID.h Thu Sep 02 16:48:10 2010 +0000 +++ b/PID.h Tue Jul 05 11:55:15 2016 +0000 @@ -164,6 +164,9 @@ float getIParam(); float getDParam(); + operator float(); + PID& operator=(float sp); + private: bool usingFeedForward;