Help For Button Box Project

Hi everyone. I have a problem and I need to your help for a project. I will trying to make button box for a few games.I am thingking use arduino leonardo but it has 20 input and I need more buttons.(+20 button switch and +10 led) How I do this project?

1)I think use matrix button but is encoder required for this? or Is only matrix code enough?

2)or would I use a datasheet like 75HC595? I can get multiple outputs from 3 pins. But I dont know how I use datasheet. My knowledge is not enough in this subject.

  1. Is there something you recommend?

Rejoice if you explain in a simple way.

74HC595 is serial in paralle! OUT. Will not work for button inputs. 74HC165 is parallel in serial out and will work with switches. Google "Arduino 74HC165". There are tutorials on their use. Another choice is the MCP 23008/MCP 23016 port expanders. They come in I2C or SPI interface.

A switch matrix may be the better way to go. It requires no extra parts and decoding done in software. There are libraries available to make it easier. Here is a page about wiring the matrix.

Maybe you could use a chip to convert button inputs to binary? Essentially making a second computer. I will use a 3 digit binary code for the example:
B# = button#, ### = input to arduino "1" = signal, "0" = no signal
No Button = 000
B1 = 100
B2 = 010
B3 = 001

B4 = 110
B5 = 101
B6 = 011

B7 = 111

This will significantly increase the number of buttons available, however it will become very complicated very quickly. I also believe this will only work for buttons, and not joysticks, which may be what you want if you are doing games. Just remember you actually need a chip to do this. If you don't have a chip it is possible with a lot of diodes.

Mega, Due and Teensey all have more than 30 IO.