64 buttons and 64 leds: how to indicate which button to press

Hello,

I have an Arduino UNO in front of me and I'm looking to connect 64 push buttons to it. To that end, I have found a "Button64 shield" that seems to enable me to do just that.

The problem that I'm encountering is that I would like to indicate which button the user should press by lighting up an LED corresponding to the button. I have found "LED Illuminated Buttons" that have a separately controlled LED.

My question is: how can I wire up the LED Illuminated Buttons so that the LED turns on indicating which button to press.

Any advice would be much appreciated.

8 shift-in registers to read the buttons,
8 shift-out registers to drive the LEDs.

Actually, if that is the shield that contains a microprocessor and an expander chip, I am somewhat surprised it does not already have the function built in.

The simplest way to do this - forget the shield - is to use two shift-out registers and a single shift-in register (all 8-bit). Even simpler; a decade counter such as the 4017, one shift-out register (74HC595) and a single shift-in register. The 4017 successively pulls matrix columns high, each column feeding a row line through an LED and a second row line through a button (and preferably, a diode in series). A shift-out register selects only one row to pull low and light an LED, while if the corresponding button is closed against a pull-down resistor, this is polled by the shift-in register.

Three ICs to do it. Notes:- This presumes you only wish to illuminate one LED at a time, so you do not need buffers to multiplex.

  • You perform the multiplexing rapidly, but in between polls, leave the multiplexing set to light the LED.
  • You need to debounce as you are not using that "Button64 shield" which performs debouncing for you. I have explained the algorithms to perform the debouncing.
  • You do need the diodes in series with the pushbuttons - as for the"Button64 shield" - if more than one pushbutton is likely to be pressed simultaneously.

Thank you both for your reply.

CrossRoads:
I suspect that you are talking about connecting (in series) 8 shift-in registers (8-bit) and connecting (again in series) 8 shift-out registers (8-bit)? If that's not the case, can you elaborate on your reply.

Paul__B:
Your assumption is correct - there will only (or should only) ever be 1 LED turned on at any one time. Also, the "Button64 shield" is this one: Arduino Shield List: SpikenzieLabs Button 64 Shield. Unless I've missed something, I don't believe that it does (or has the capability to do) what I want it to do. If you think otherwise, let me know. I'll have to read more about the decade counter.

Yes, daisy chained.
8 spi.transfers to read 8 more to write.
Or do both at once.

for (x=0; x<8; x=X+1);
byteIn[x]=spi.transfer([byteOut[x])
};

dyno:
Your assumption is correct - there will only (or should only) ever be 1 LED turned on at any one time. Also, the "Button64 shield" is this one: Arduino Shield List: SpikenzieLabs Button 64 Shield. Unless I've missed something, I don't believe that it does (or has the capability to do) what I want it to do.

I think that was the one I found by Google using your description. But it clearly does the button inputs, and I am quite sure it would necessarily include the debouncing, but have no interface for the LEDs.

dyno:
I'll have to read more about the decade counter.

The decade counter (74HC4017) is just the simplest - least complicated - way of getting one high output only and shifting that high from one output to the next. You need only clock and reset to do it and you can possibly common the reset with something else (unrelated to the shift registers).