diff --git a/PID_v1.cpp b/PID_v1.cpp index 09b9261..86222c7 100644 --- a/PID_v1.cpp +++ b/PID_v1.cpp @@ -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(); }