bneedhamia / glockenspiel

Arduino Robotic Glockenspiel (xylophone)
Other
6 stars 0 forks source link

millis() overflow isn't handled properly #9

Open bneedhamia opened 7 years ago

bneedhamia commented 7 years ago

All lines of the form if ((millis() - changedButtonOnMs) > MAX_BOUNCE_MS) { should instead read if ((long) (millis() - changedButtonOnMs) > MAX_BOUNCE_MS) { to match the pattern described in https://playground.arduino.cc/Code/TimingRollover

The bug will cause strange things to happen after running constantly for a few days.