ArduPID icon indicating copy to clipboard operation
ArduPID copied to clipboard

How do we change the setpoint dynamically?

Open alexiscruzdavid opened this issue 2 years ago • 1 comments
trafficstars

How can we change the setpoint, the desired value to achieve, dynamically in the loop(). I want to change the value of setpoint depending on an input the user gives. Is it simply just running controller.begin() again? Or is that wrong?

alexiscruzdavid avatar Mar 08 '23 09:03 alexiscruzdavid

All you need to do is change the value of the variable you're using to save the setpoint in. The library uses pointers to monitor parameters like the setpoint, so controller.begin() is only necessary once (for setting up the controller).

PowerBroker2 avatar Mar 08 '23 14:03 PowerBroker2