Skip to content

Commit

Permalink
Fix bug in overload constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
guilhermgonzaga committed Jan 20, 2022
1 parent 44fa110 commit d096e6d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/QuickPID.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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 *********************************************************************
Expand Down
2 changes: 1 addition & 1 deletion src/QuickPID.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit d096e6d

Please sign in to comment.