From d096e6d60d7215268f470c566fa55b1782686784 Mon Sep 17 00:00:00 2001 From: Guilherme Gonzaga Date: Thu, 20 Jan 2022 12:50:28 -0400 Subject: [PATCH] Fix bug in overload constructor --- src/QuickPID.cpp | 8 ++++---- src/QuickPID.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/QuickPID.cpp b/src/QuickPID.cpp index 1af5f2b..b218f1e 100644 --- a/src/QuickPID.cpp +++ b/src/QuickPID.cpp @@ -21,7 +21,7 @@ QuickPID::QuickPID(float* Input, float* Output, float* Setpoint, pMode pMode = pMode::pOnError, dMode dMode = dMode::dOnMeas, iAwMode iAwMode = iAwMode::iAwCondition, - Action action = Action::direct) { + Action Action = Action::direct) { myOutput = Output; myInput = Input; @@ -30,7 +30,7 @@ QuickPID::QuickPID(float* Input, float* Output, float* Setpoint, QuickPID::SetOutputLimits(0, 255); // same default as Arduino PWM limit sampleTimeUs = 100000; // 0.1 sec default - QuickPID::SetControllerDirection(action); + QuickPID::SetControllerDirection(Action); QuickPID::SetTunings(Kp, Ki, Kd, pMode, dMode, iAwMode); lastTime = micros() - sampleTimeUs; @@ -40,12 +40,12 @@ QuickPID::QuickPID(float* Input, float* Output, float* Setpoint, To allow using pOnError, dOnMeas and iAwCondition without explicitly saying so. **********************************************************************************/ QuickPID::QuickPID(float* Input, float* Output, float* Setpoint, - float Kp, float Ki, float Kd, Action action) + float Kp, float Ki, float Kd, Action Action) : QuickPID::QuickPID(Input, Output, Setpoint, Kp, Ki, Kd, pmode = pMode::pOnError, dmode = dMode::dOnMeas, iawmode = iAwMode::iAwCondition, - action = Action::direct) { + action = Action) { } /* Constructor ********************************************************************* diff --git a/src/QuickPID.h b/src/QuickPID.h index b4c750e..394b7f3 100644 --- a/src/QuickPID.h +++ b/src/QuickPID.h @@ -26,7 +26,7 @@ class QuickPID { QuickPID(float *Input, float *Output, float *Setpoint); // Sets PID mode to manual (0), automatic (1) or timer (2). - void SetMode(Control mode); + void SetMode(Control Mode); // Performs the PID calculation. It should be called every time loop() cycles ON/OFF and calculation frequency // can be set using SetMode and SetSampleTime respectively.