forked from br3ttb/Arduino-PID-Library
-
Notifications
You must be signed in to change notification settings - Fork 58
Closed
Description
"if (msNow > nextSwitchTime) { nextSwitchTime = msNow + debounce;"
is used in the PID_RelayOutput example,
When nextSwitchTime overflows, the comparison results for the next cycle will be wrong.
//should use
if(millis() - lastMillis >= interval){
//and NOT like
if(millis() >= lastMillis + interval){
Dlloydev
Metadata
Metadata
Assignees
Labels
No labels