# Stepper motor project

**URL:** <https://forum.arduino.cc/t/stepper-motor-project/1252713>\
**Category:** LEDs and Multiplexing\
**Created:** [April 27, 2024, 6:43am UTC](https://forum.arduino.cc/t/stepper-motor-project/1252713 "2024-04-27T06:43:42Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![xfpd](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/xfpd/32/1120236_2.png) [@xfpd](https://forum.arduino.cc/u/xfpd)\
**Post date:** [April 27, 2024, 8:19pm UTC](https://forum.arduino.cc/t/stepper-motor-project/1252713/5 "2024-04-27T20:19:15Z")

</div>

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

> **[buttonChangeStatesUsingMillis - Wokwi ESP32, STM32, Arduino Simulator](https://wokwi.com/projects/395928748514899969)**
>
> Run IoT and embedded projects in your browser: ESP32, STM32, Arduino, Pi Pico, and more. No installation required!

---

_[View the full topic](https://forum.arduino.cc/t/stepper-motor-project/1252713)._
