When using this I am getting a lot of weird voltage spikes as shown below. As far as I can tell this shouldn't be happening while the switch is closed and I'm starting to wonder if I have a defective arduino somehow. Help is much appreciated.
"If the analog input pin is not connected to anything, the value returned by analogRead() will fluctuate based on a number of factors (e.g. the values of the other analog inputs, how close your hand is to the board, etc.). "