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.
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;