5 buttons on one pin.

I have just had an Idea. Could I make it using one button with a time button is pressed for to set the value the capacitors are charged to? Also have an led blink while the butoon is pressed ie 1 secong 1 flash of led and charge to (x). two secconds two flashes of led and charge to (y). ETC
If this is possible how would i write the delay in button pressed time?
Thank you all for your input so far.
Jezza