example of using one analog pin to read 5 switches

Just barging in as i'm playing with a robot that has 6 buttons as bumper. The way they implemented those results in;

button analog reading
pressed value
1 1
2 2
3 4
4 8
5 16
6 32

This way even multiple buttons pressed isn't a problem anymore.
( example; buttons 1 and 2 pressed gives an analog reading of 3.)

Schematic; http://www.arexx.com/downloads/asuro/asuro_manual_en.pdf page 74. Asuro Diagram.

Lower resolution picture of schematic. http://img29.mediafire.com/c5dcf2f463c2d7755f5a330f17a8fb8a5g.jpg

Hope this helps a little. Otherwise just ignore.

Jeroen

In know this is an old thread, but is new to me.

Instead of fooling around with all these resistors, why not go digital instead? Picture a line of '74 D-Type flip-flops wired up like a shft register - common clock, common clear, each Q outout feeding the next D input, the final one going into a digital pin.
However - have the Preset lines individually pulled high, with a momentary button taking it to ground, which brings the output high for that one flip flop - then periodically shift the bits in to the Arduino,anc Clear the FFs after reading. Can make the string as long as you want. Need 3 pins: Shift Clock (output), Clear (output), and the data that gets shifted in.
There are challenges, such as determining when to shift in, and how to keep the user from pressing buttons while shifting in. I suppose one could could Wire-Or the Q/Low outputs such that any one going low could be used as an interrupt to tell the Arduino to go shift the bits in.

Upside - no worrying about voltage value changes with resistance change over temperature or time, uniquely captures all events.
Downside - takes more than one pin.

Robert