You really should not be setting internal parts of the library - ctr.out=0.0;
At this point - you could call ctr.compute(); if you have set a value for input. There is a ctr.setOutput(x) - however this is intended to be used if the controller in manual mode.
Same goes for getting the output ctr.getOutput(). If the internal implementation of the library was changed and internal vars renamed (i.e. perhaps shorted to save space), your code could break...
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Great to see you testing the code.
You really should not be setting internal parts of the library -
ctr.out=0.0;
At this point - you could call
ctr.compute();
if you have set a value for input. There is actr.setOutput(x)
- however this is intended to be used if the controller in manual mode.Same goes for getting the output
ctr.getOutput()
. If the internal implementation of the library was changed and internal vars renamed (i.e. perhaps shorted to save space), your code could break...