Example sketch using buttons attached to an Arduino. The circuit consists of voltage dividers attached to the digital input and one lead of the button, the other lead of the button to power.
I used arcade buttons from Sparkfun, but this will work with any switch or button.