I'm using the PID_v1 library. I am averaging my process variable and I need to know when the compute executes to reset my average. How can I tell when this happens?
Looking at the Compute() function, it shows that it returns TRUE or FALSE.
Contains the pid algorithm. it should be called once every loop(). Most of the time it will just return without doing anything. At a frequency specified by SetSampleTime it will calculate a new Output.
Syntax
Compute() Parameters None Returns True: when the output is computed False: when nothing has been done
How do I evaluate this? I've tried passing a boolean - PidAngle.Compute(PidAngleDn)
The PID library executes at preset intervals using PidSpeed.SetSampleTime(100); <- This will execute at 100ms intervals. I need to know when it actually executes so I can reset the average of the process variable. I may just try to use a moving average but I would still like to know when it actually executes for other reasons.
@UKHeliBob - I haven't tried to print the PidSpeed.Compute() in a variable. I've just added debug counters ++TempCnt; in there and printed those to an LCD but they never increment.
@PaulS - It isn't expected to "fail", it just executes based on it's preset interval.
All of the code is too long to post... The message exceeds the maximum allowed length (9500 characters).