Arduino-PID-Library icon indicating copy to clipboard operation
Arduino-PID-Library copied to clipboard

Relay Example - Output Drop

Open jnosky opened this issue 7 years ago • 3 comments

Line #54 if (millis() - windowStartTime > WindowSize) Should be: if (millis() - windowStartTime >= WindowSize)

Existing code will drop the relay output briefly when the = event sometimes occurs

jnosky avatar Jun 13 '17 12:06 jnosky

Where's the error (what file?)? Couldn't locate it. Wasn't it changed to lastTime and corrected?

edgsc avatar Sep 22 '17 18:09 edgsc

Relay Example? Line #54? What do you mean you can't find it?

jnosky avatar Sep 29 '17 11:09 jnosky

You are right! The original line 54 of Relay Example is like the first one you said and your point makes sense. If millis(s) - windowStartTime were = WindowSize, Arduino would do nothing and "skip a cycle".

Thanks for your contribution, I added it to my experiment too =)!

edgsc avatar Sep 29 '17 11:09 edgsc