Merge pull request #56 from zcx119/patch-1

Condition update for mode change from manual to auto.
This commit is contained in:
br3ttb 2017-02-15 05:05:27 -08:00 committed by GitHub
commit 5adeed52b0

View File

@ -146,7 +146,7 @@ void PID::SetOutputLimits(double Min, double Max)
void PID::SetMode(int Mode) void PID::SetMode(int Mode)
{ {
bool newAuto = (Mode == AUTOMATIC); bool newAuto = (Mode == AUTOMATIC);
if(newAuto == !inAuto) if(newAuto && !inAuto)
{ /*we just went from manual to auto*/ { /*we just went from manual to auto*/
PID::Initialize(); PID::Initialize();
} }