From 21b19e7ab0c4d4b2e01409cc122fb21f8f6a706b Mon Sep 17 00:00:00 2001 From: zcx119 Date: Tue, 14 Feb 2017 23:38:57 +0800 Subject: [PATCH] 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. --- PID_v1.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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(); }