Skip to content

New robust debouncing algorithm

Choose a tag to compare

@solamyl solamyl released this 27 Dec 21:49
· 7 commits to master since this release
989c011

debouncing algorithm replaced with a robust one

  • the original algorithm was as simple as possible: after detecting a change, wait for a defined period of time, then read input again and that is a new stable state.
  • the new algoritm checks the input in each loop and monitors how long it has been stable. If the stable period is longer than the defined time, then a new stable state is reported. No other changes in functionality, just the debouncing algorithm.
  • object's memory reduced by 2 bytes

m_changed member removed

  • m_changed was replaced with an expression lastState!=currentState
  • new method changed() added