Connecting almost any type of switch to an Arduino's digital output pin will require a method of de-bouncing, that is avoid the incredibly fast on/off cycling from the switch. One method to avoid this is to simply put delay statements after polling an input, however this freezes the entire sketch.
An interesting alternative has been created by Mike Schwager who wrote an Arduino library called "tigger" which is used to handle bouncing in software, through pin-change interrupts and allows for a more logical form of reading digital inputs.
Using the library is quite easy, the instructions and downloads can be found on Mike's project page. And for more, we're on facebook, Google+, and twitter - so follow us for news and product updates as well.