In most designs you might want to put buttons and switches to control your program flow. This is not very difficult to read button state. You can connect button between pin and ground with internal pull up enabled. Then when button is pressed, then pin value will beâ€0†when released – “1â€. Of course you can use external pull-up resistor.

In fact all mechanical contacts have their shortcomings – they generate multiple micro connections that can confuse AVR. Delay of this effect depends on quality of buttons or switches and can vary from 10 to 100ms.

Usually this effect is removed in programming stage by using delays for waiting switch stage to become stable.
If you want to put more buttons than you microcontroller have pins, you can construct matrix style button system:

You see with only 8 pins you can read 16 buttons. All other job will do your algorithm.