controlling several LED's with one button

hello,
I am currently trying to make a scoreboard for a game that i bought. the scoreboard needs 14 led’s to be powered sepretly so when i get a point i press the button and one led lights up all the way up threw 9 and then it lights up an led underneath that’s says 10 and so on. there will only be one button on the board, what should my code be.

thanks,
nick

What have you got so far?
What is your circuit?

Only one button?

In that case:

How will you reset the score for each game?

How will you correct a mistake if you press the button accidentally?

fungus:
Only one button?

In that case:

How will you reset the score for each game?

How will you correct a mistake if you press the button accidentally?

Press and hold x seconds = reset
Press manualy the game score again.
And so on..

Lots of opportunties with just one button.

MrMr:
Press and hold x seconds = reset
Press manualy the game score again.
And so on..

Lots of opportunties with just one button.

Sure...but you come in here and say "what should my code be?" then suddenly start changing the specifications? The people here aren't machines who'll write and rewrite code for you, they have lives of their own.

PS: That's a horrible user interface. Is there any reason why you can only have one button?

fungus:

MrMr:
Press and hold x seconds = reset
Press manualy the game score again.
And so on..

Lots of opportunties with just one button.

Sure...but you come in here and say "what should my code be?" then suddenly start changing the specifications? The people here aren't machines who'll write and rewrite code for you, they have lives of their own.

PS: That's a horrible user interface. Is there any reason why you can only have one button?

Its not me who wrote the topic. I just answered that it could be done with one button. I agree with the other aspects you said.

MrMr:
Its not me who wrote the topic. I just answered that it could be done with one button. I agree with the other aspects you said.

My bad.

The point stands though, I think the design needs work before starting to write any code.

fungus:

MrMr:
Its not me who wrote the topic. I just answered that it could be done with one button. I agree with the other aspects you said.

My bad.

The point stands though, I think the design needs work before starting to write any code.

I agree on that :slight_smile:

First of all, You could control numbers more easily using a 7 segment display. So instead of configuring 10 LEDS, just use one of these displays and save some time.

Consider some debouncing code for the buttons too. Read about it more in the links:

This is a very neat debounce tutorial:
http://www.ladyada.net/learn/arduino/lesson5.html

mixania:
First of all, You could control numbers more easily using a 7 segment display. So instead of configuring 10 LEDS, just use one of these displays and save some time.

He might be making a cribbage score board, so 7-segment LEDs don't work. :slight_smile:

He seems to have gone away though.