Hello! I'm new to Arduino and I'm trying to make a 24 second shot clock for a basketball game. I already made it in a way that it will change from 24 and 14 seconds. My problem is I can't figure out how to add a start and pause. Can someone help me? Here is my code from which I just found on the internet then tweak it a little.
Welcome to the forum. Just a quick note, people are more likely to read your code if it is posted as text rather than if they have to download it. Please post your code as text, remembering to use the code tags (the </> button on the text editor).
My problem is I can't figure out how to add a start and pause.
You haven't told us what you want to use to trigger the start or the pause, either, so we can't write the code for you.
If you plan to use a switch, how will you connect it? What pin mode will you use? The state change detection example will show you how to determine that a switch HAS BECOME pressed, rather than IS pressed, or HAS BECOME released, rather than IS released.
When the switch HAS BECOME pressed seems like a good time to start, or pause, the timing activity. Note that I did not say start or pause the timer, because you do NOT want to be diddling with timers.