Condition update for mode change from manual to auto.
Minor update on the condition of initialization when changing mode. To only detect mode change from manual to auto.
This commit is contained in:
@ -146,7 +146,7 @@ void PID::SetOutputLimits(double Min, double Max)
|
||||
void PID::SetMode(int Mode)
|
||||
{
|
||||
bool newAuto = (Mode == AUTOMATIC);
|
||||
if(newAuto == !inAuto)
|
||||
if(newAuto && !inAuto)
|
||||
{ /*we just went from manual to auto*/
|
||||
PID::Initialize();
|
||||
}
|
||||
|
Reference in New Issue
Block a user