SetMode(...)**************************************************************** * Allows the controller Mode to be set to manual (0) or Automatic (non-zero) * when the transition from manual to auto occurs, the controller is * automatically initialized ******************************************************************************/
| 173 | * automatically initialized |
| 174 | ******************************************************************************/ |
| 175 | void PID::SetMode(int Mode) |
| 176 | { |
| 177 | bool newAuto = (Mode == AUTOMATIC); |
| 178 | if(newAuto && !inAuto) |
| 179 | { /*we just went from manual to auto*/ |
| 180 | PID::Initialize(); |
| 181 | } |
| 182 | inAuto = newAuto; |
| 183 | } |
| 184 | |
| 185 | /* Initialize()**************************************************************** |
| 186 | * does all the things that need to happen to ensure a bumpless transfer |
nothing calls this directly
no outgoing calls
no test coverage detected