10 switch inputs 10 LED outputs HELP!

Hey arduino world I have a project that I would love some help on here is the scenario.

10 contact switches linearly contacts one through ten when contact one is connected i want LED 1 to be on when contact two is connected i want LED 1 + 2 to be on when contact three is connected i want LED 1 + 2 + 3 to be on... and so on till contact switch ten and LED 10

first question is, is there a way to easily connect 10 contact switches to the arduino duemilanove? second questions is, is there a way to easily connect 10 LEDs to the board directly third questions is, i would like it if the time between contact switch one and contact switch ten is less than 100 milliseconds than i want LEDs 1-10 to pulse on and off rapidly for 1 sec. what kind of code would i need to write

Sorry i hope these are not dumb questions i am just new at this and want to work on a great project but i need the basics. any help would be great. either reply on the forum or message me directly any help would be greatly appreciated.

first question is, is there a way to easily connect 10 contact switches to the arduino duemilanove? second questions is, is there a way to easily connect 10 LEDs to the board directly

Well as you have 20 I/O pins I would say yes. But you have no pins left for anything else. Maybe you want to attach the LEDs to two shift registers.

i would like it if the time between contact switch one and contact switch ten is less than 100 milliseconds than i want LEDs 1-10 to pulse on and off rapidly for 1 sec. what kind of code would i need to write

The usual stuff read / write timing sort of code.

What you really want, I think, is a 16-to-4 priority encoder, and a 4-to-16 decoder.

The encoder converts the input into a binary number between 0 and 15. The decoder converts a binary number into one output out of 16 enabled.

The whole thing would take 8 IO lines - 4 for the encoder, 4 for the decoder.

http://en.wikipedia.org/wiki/Priority_encoder http://en.wikipedia.org/wiki/Decoder

What you really want, I think, is a 16-to-4 priority encoder, and a 4-to-16 decoder.

Are you sure? I can't see that doing what he wants.

Sorry, missed the bit about multiple LEDs wanting to be on.

In that case, yes, a shift register would be best for the output. You still want the priority encoder for the input tho.

You still want the priority encoder for the input tho.

Well only to reduce the pin usage count, the functions of it can be handled perfectly in software.