I am trying to make a program to control some LED's. There are two inputs. English and French. Each input also has an LED. Before anyone has pushed a button, the LED's will flash alternately. Once someone pushes the a button, that button will stay illuminated for X amount of time. Then go back to alternate flashing.
My code is a bit messy right now, but I'm looking for advice on concept. Is it possible to:
Run a loop until digitalRead detects a HIGH. Then - digitalRead runs if statement loop. That loop will run for X amount of seconds. Then return to main loop. I cannot use delay commands since I need it to always be open to input even during the timed loop. Ie. While running the second loop, pushing a button can restart that loop.
Biggest thing I'm looking for is how to run an if statement for X amount of time, then to go back to the main loop.
Hope that is clear.