Need help with a button to turn every led off

How can I implement a button in this code to turn off all the LEDS?
3 Replies
Alexei
AlexeiOP2w ago
I also have another arduino with 2 7 seg displays and I need them to turn off as well when I press the button, not sure how to do that though
pseud0
pseud02w ago
Don't use delay(), it prevents your ability to react to something immediately. Use the blink without delay technique instead, only checking millis() value. https://docs.arduino.cc/built-in-examples/digital/BlinkWithoutDelay/

Did you find this page helpful?