You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"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){
Thank you for pointing this out. Even though the effect is very minimal on the output, I'll take a look at updating the function to prevent the overflow issue.
Activity
Dlloydev commentedon Jun 16, 2022
Thank you for pointing this out. Even though the effect is very minimal on the output, I'll take a look at updating the function to prevent the overflow issue.
Dlloydev commentedon Jan 6, 2023
Converting this to discussion. Will do some additional testing and possible update for a future release.