I'm almost done with my project. I mounted a switch to the machine which will signal my Arduino Uno to activate a 12 volt solenoid for 1 second. I've assembles all of the parts and wired it up on a breadboard. I've written the program and everything is working...... except for one thing. The switch will input twice for every desired output. I want the Arduino to output a signal to pin 2 the first time that the switch is pressed and released, and not the next time, and so on. I tried having a counter which advanced and then using the modulo when divided by 2 and comparing that to 0, but failed somehow. Other than taking another run at that is there some other idea to look at?