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.

Required fields*

4
  • 3
    insert a layer of separation between the button press and the LED lighting ... use a flag variable .... if (digitalRead(buttonON)== LOW) ledsON = true; .... then further down in the code if (ledsON) { / led lighting code } ... you can set/clear ledsON flag any number of times, so you could check the button after every led is lit ... that way you don't have to hold the button until the sequence is finished Commented Jul 20, 2021 at 2:44
  • 1
    good way of asking question ;) Nicely written, formatted +1 Commented Jul 20, 2021 at 9:43
  • 1
    I take it you are new to programming? Commented Jul 20, 2021 at 11:17
  • yes, like i said, I've just started, and decided to start programming with Arduino Commented Jul 20, 2021 at 18:04