From a781db1f8bc0e7225858e42075728619c593aeb7 Mon Sep 17 00:00:00 2001 From: Matthew T Watson Date: Thu, 30 Apr 2020 21:49:20 +0100 Subject: [PATCH] Fixed bug in which setDirection doesn't do anything until gains are updated. --- MiniPID.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MiniPID.cpp b/MiniPID.cpp index 18cc516..725e0e9 100644 --- a/MiniPID.cpp +++ b/MiniPID.cpp @@ -162,6 +162,8 @@ void MiniPID::setOutputLimits(double minimum,double maximum){ */ void MiniPID::setDirection(bool reversed){ this->reversed=reversed; + checkSigns(); /* Invert gains if necessary. Without this call gains provided via the constructor won't be changed, and direction won't reverse. */ + } //**********************************