Stopwatch with multiple LEDs and one control button

Hi everyone,

I'm not sure if this is simple or not, but I'm a beginner and just purchased an Arduino Uno. I need to build a stopwatch function which will run like this... I have some base code that I've found on the forum but I was wondering if anyone has made anything similar to this:

  • 1 control button which starts a timer and lights up 1 LED light (randomized)
  • the user has to push the button of the lit up LED light which stops the timer and turns off the LED
  • time is collected and data put in .CSV file
  • start again at the control button which will re-start the timer from 0 and light up another LED light etc.

So there is 1 control button which starts the timer, there will be 3 pairs of LEDs and buttons that will stop the timer. Hope this makes sense and I appreciate any feedback!

sounds more like a game than a stopwatch

when people write code for a stopwatch, they mean a stopwatch

ht2016: So there is 1 control button which starts the timer, there will be 3 pairs of LEDs and buttons that will stop the timer. Hope this makes sense and I appreciate any feedback!

Sounds like you want some "reaction time measurement", perhaps with showing the final "reaction time on Serial? Would be easy.

You will have to code "state change detection" for all four buttons, and accordingly to buttons pressed your code will control three states of your stopwatch - stopwatch ready for next measurement - stopwatch started - stopwatch stopped