Build reflexes game w/ about 30 LED buttons

Hi everybody,

I'm a programmer, new to hardware, this will be my first project.

I'm thinking of building a high speed reflexes game. Basic idea is you have to push a momentary button as soon as the LED in the button is lit, which turns the LED off.

Should be lots of fun w/ a bunch of buttons randomly being lit (and switched off by the player). Ideally I'd make this a two-player game, so players can go head-to-head. (This would involve a display to keep the score in real-time, and possibly some lights to indicate who's ahead - e.g., table glows blue when blue player is in the lead, yellow for the other player).

I'm guessing a button shield like this one should make my build easier.

Would an Arduino Uno be quick enough to process all this quickly enough, i.e., roughly 30 LED's being randomly lit and turned off by pushing the buttons by two players simultaneously (each of whom could potentially hit a couple of buttons at almost the exact same time), real-time score counting and controlling a couple of RGD LED strips.

What are your thoughts on this? I'd love to hear your suggestions on how to get started (again, I'm a programmer, complete newbie to hardware, so I have a lot to learn when it comes to powering the build, will probably need to adjust voltages, etc).

Thanks!
Robert

Hi Robert,

You are already a programmer, so if its a hardware learning experience you are looking for, I think it's possible that shield may ruin your opportunity, by doing too much for you without you truly understanding how its being done.

Also, you need each button to be lit under individual control, and I don't think that shield will help with that, so you would still have to design the led side of things.

If you decide to go with that shield, I would recommend using a max7219 chip to control the button leds. It can run up to 64, so that would cover 30 for each player plus a few extra for indicating the current winner.

Yes, an Uno or similar will be fast enough (assuming you don't write your code inefficiently!).

For your score displays, the simplest option would probably be a 16x2 lcd. Get one with a serial adaptor or you may run out of Arduino outputs!

If you want LED 7-segment score displays, again, a max7219 can drive up to 8 digits (common cathode) and could be daisy-chained to the other one controlling the button leds, so no more Arduino outputs are needed.

There is an opportunity to design a combined switch and led matrix, which I feel sure could simplify the wiring versus separate switch and led matrixes....

Paul

Thanks Paul! Appreciate your sharing your thoughts.

So the reason I selected the Button Shield was that I thought I wouldn't have enough inputs on the Uno. And since it is button input I need, it made the most sense to go that route.

A combined switch and led matrix would definitely simplify wiring. On the other hand, I'd expect that combining in- and output would result in reduced cleanliness of my code. Guess both strategies have their pro's and con's. Having said that: how would you combine the two?

As for the LED 7-segments, they seemed most appropriate for clear view in dark rooms.

Oh, and for completeness: are you suggesting to put a max7219 in between the Uno and multiple LED 7-segments?

rtomoham:
So the reason I selected the Button Shield was that I thought I wouldn't have enough inputs on the Uno.

If you arrange your buttons in a matrix, you can drastically reduce the number of inputs required. I assume that's what that shield does, but you can do it with the Arduino just the same. I assume the shield is targeted at customers who are less experienced around software and hardware, and it makes it easy for them.

rtomoham:
A combined switch and led matrix would definitely simplify wiring. On the other hand, I'd expect that combining in- and output would result in reduced cleanliness of my code

Better to have the extra complexity in the code rather than the hardware, especially if you are experienced with software.

rtomoham:
how would you combine the two?

There must be a way... at the moment I can't quite picture it, unless you were to use 8 Arduino outputs for driving leds on the rows in the matrix and another 8 Inputs for sensing the button states on the same row. You would select one column at a time using a shift register (e.g. tpic6c595) which only needs 3 outputs, 2 of which could be shared with the max7219.

Ideally it would be best to find a way of using the same 8 pins for both the outputs for the leds and as inputs for the switches....

rtomoham:
are you suggesting to put a max7219 in between the Uno and multiple LED 7-segments?

Yes. A max7219 is the easiest way to drive up to 8 digits of 7-seg display. That is, if it is a bare display. The modules you gave the link for earlier may have had built-in drivers of some kind. Using modules like that could be described as a lost opportunity to learn about hardware, so that's up to you to decide.

If you use the button shield, then the easiest way to drive the button leds would be another max7219.

Thanks again Paul.

Indeed, I'll have to choose between the easy solution and a steeper learning curve (but delivering more control and gratification in the end). Not sure which way to go right now, but I'll definitely give it some more thought though.

Either way, it'll be a fun project and nothing will stop me from going down the other path once this first project is a success :wink: