2 pin pushbuttons + DigitalReadSerial tutorial

Hi everyone,

I just got my first Arduino Uno R3 today and I've started doing the tutorials on the arduino.cc site, however I reached a bit of a problem when I started the DigitalReadSerial (http://arduino.cc/en/Tutorial/DigitalReadSerial) tutorial as in I only have pushbuttons with 2 pins. Is there any way to still do the tutorial (it shows a 4 pin button with 3 pins being used) with my pushbuttons or do I need to go out and get some 4 pin buttons?

Thanks in advance!

No, those breadboard push buttons have 4 legs for mounting, but there are only 2 connections. On the Fritzing diagram, the two legs on the bottom are electrically joined together, as are the two legs on the top.

I find using input pullups is simpler because you don't have to add a resistor, and you only need 2 wires (ground and to the data pin). The downside is digitalRead returns LOW when the button is pressed, and HIGH when it is released, so you need to invert your test: http://arduino.cc/en/Tutorial/InputPullupSerial

MichaelMeissner: No, those breadboard push buttons have 4 legs for mounting, but there are only 2 connections. On the Fritzing diagram, the two legs on the bottom are electrically joined together, as are the two legs on the top.

I find using input pullups is simpler because you don't have to add a resistor, and you only need 2 wires (ground and to the data pin). The downside is digitalRead returns LOW when the button is pressed, and HIGH when it is released, so you need to invert your test: http://arduino.cc/en/Tutorial/InputPullupSerial

Thank you so much! Works great.