Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • It's called an interrupt. Commented Feb 13, 2021 at 16:49
  • 2
    I most cases, this isn't an issue. Humans are kind of slow, compared to an Arduino running at 16Mhz. Pressing a button takes tens to hundreds of milliseconds. An eternity for a CPU. Alternatively, you could add an RC circuit to the button. This has the added benefit of also debouncing the button signal. Commented Feb 13, 2021 at 17:25
  • Just a SWAG but it sounds like you are using the delay(); function, that is blocking the arduino not allowing it to do anything else until finished. Work with the millis(); function, you code will be non blocking. Commented Feb 13, 2021 at 17:53