PowerBroker2/ArduPID

How do we change the setpoint dynamically?

alexiscruzdavid opened this issue · 1 comments

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?

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).