Stepper motor project

Here is an example of debouncing a button...

  1. read the button
  2. has the button changed states (HIGH to LOW or LOW to HIGH)
  3. if yes, start a timer...
  4. ... and store the new button state
  5. if the timer has exceeded my chosen timeout (50 ms for me)...
  6. ... check if the button STATE is in the NOT PRESSED state, and the button (not state) is the PRESSED (LOW)
  7. end of debounce, call a function