Using multiple push buttons with an arduino

Hi again everyone,

Trying to just get some information before i start soldering again (been at it for about 2 hours and then realized i had a problem). I am trying to make a Menu based interface on an LCD screen using 6 push buttons (Up, Down, left, right, enter, back). My problem is that i'm am a bit confused as to how to wire up multiple push buttons. I was originally using Ladyada's tutorial here Arduino Tutorial - Lesson 5 .... but pretty much got lost when she started using the two resistors as i had seen others just use one. I've been trying to find an example with more than one push button in use but I've been unsuccessful so far (may not be looking hard enough). So i started with the basics i.e. one switch, one resistor as in this tutorial http://arduino.cc/en/Tutorial/Button .

So my question is for most practical purposes (dual state, debounced switch reading) will a single resistor be enough? If i can use a single resistor fine will i need one for each switch and pin? (i have enough 10k ohm resistors but it would help keeping complications down.) supposing this would allow me to succesfully (either by using a resistor for each switch and pin or some other bridged solution) would that work with this sketch and setup http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1242443739/0#5 ?

Kinda feeling like i'm really missing something and i would really like to get this thing done. Would anyone have any ideas as how to get past these few issues? Thanks in advance for any help.

First off thanks for the reply,

Well i looked at that technique earlier and while it does make things easier in terms of saving pins, i would have no idea where to start when i get to the menu selection etc. phase. Would i just be able to use multiple iterations of the circuit i referenced earlier at http://arduino.cc/en/Tutorial/Button and just have one for each switch? i would try the other one but my resistor inventory (quite small as i only recently started) is:

10 x 10k ohm resistors
5 220 ohm resistors
5 330 ohm resistors
2 10k ohm potentiometers

not really sure i can do it from those components and i want to avoid buying more components for now.

I do have enough pins for the buttons. My question is how do i wire up 6 push buttons to an arduino. Do i just duplicate the circuit here 6 times http://arduino.cc/en/Tutorial/Button ? or must i do somethign different.

If you have enough pins you just duplicate it 6 times.

Awesome i'll get working on that right away. Thanks again. One other question. Do you happen to know where i can find an example of someone using the same 6 button setup to control a menu based interface on an lcd? I found one example but it only uses up, down, back and enter (http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1242443739/0#5).

Heh yeah i actually do have c++ coding experience ..... guess i was just being lazy. Will look into it and post the code once i get it working .... who knows maybe it might help someone else trying to be lazy :stuck_out_tongue:

Hi all

may find it interesting to see the following pages:

multiple buttons

multiple buttons in an analog input

Multiple buttons on a digital input

The pages are in Spanish, but have plenty of pictures and have a machine translator in the top right of the page