Update PID_v1.cpp

Don't need ```else output = 0``` because it becomes the default case during variable assignment ```double output = 0;```, if ```(!pOnE)```
This commit is contained in:
Isaac Rodman 2021-08-03 18:02:43 -07:00 committed by GitHub
parent 9b4ca0e5b6
commit 79e5cc533a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -75,9 +75,8 @@ bool PID::Compute()
else if(outputSum < outMin) outputSum= outMin;
/*Add Proportional on Error, if P_ON_E is specified*/
double output;
double output = 0;
if(pOnE) output = kp * error;
else output = 0;
/*Compute Rest of PID Output*/
output += outputSum - kd * dInput;