Help with Multiple LED Project for Hockey

Hello, I'm a total newbie to this site as well as programming in general. There is definitely a lot of useful info on here. I've checked out some of the information regarding timers involving LEDs, but I haven't found anything that answered what I'm looking to do. I recently bought a table hockey game, and I want to simulate what happens at an actual hockey game.

Would it be easier to use a breadboard or just the Arduino for this project? I apologize for not being very knowledgeable in this subject matter. In terms of lights, I only plan on using one green LED and one red LED for this project. Basically, I want to have a green LED be off for 180 seconds and then turn on for 5 seconds to simulate the end of a period, and then turn off. I'd plan on pressing reset at the end of the period to start the next period. When a goal is scored, how could I press a button on the breadboard to make the red LED turn on for 5 seconds and then turn back off, and not interrupt the 180 second timer for the green LED? Any help for developing this code would be greatly appreciated, and I apologize if I have offended anyone with this post for my lack of experience.

Your best friend in this case is the millis() function of the Arduino version of C. When you call millis(), it returns the number of milliseconds elapsed since the program began. This number can go up pretty fast, so you must declare any variables involved with the timing as unsigned long (i.e, 32 bit positive numbers).

OK, so how do you turn on an LED for 3 minutes? That's 180 seconds, or 180,000 milliseconds. (My how time flies!)

So here's a little pseudocode.

void loop()

If (button pressed)
later = millis() + 180000;
digitalWrite(redLEDPin, HIGH); //means you have this pin operating the red LED

if (millis() > later) digitalWrite(redLEDPin, LOW);


what you ask is very easy and sounds like a great beginner project.

need a board, I currently favor the Nano with the screw shield.

some LED's and buttons. ebay arcade button

you could get a SD card mp3 player and it could play the horn or other sounds for you.

I can see you putting in a IR beam across the goal for score keeping.

Thanks a lot for the tips. I bought a kit and am waiting on it to arrive, so I was looking to get a head start on it. Instead of pushing reset to start the timer though, I figured it'd probably be easier just to have two buttons on the breadboard. I appreciate the pseudocode jrdoner, and if you want to help me out with that more detailed project, that'd be great Dave! Thanks again!