LED tactile button hook-up

Hi guys,

I can't manage to hook up the LED tactile button from Sparkfun. I guess I'm retarted but I don't get it.

If someone could explain how to hook it up it would be much appreciated.

This is the breakout board I'm using:

Thx!

C and A are the Cathode (-) and Anode (+) sides of the LED. Hook those up like an LED. Typically you would connect in series with a current limiting resistor (220 to 1000 Ohms). Anode to a digital output pin and Cathode to Ground. Set the pin HIGH for ON and LOW for OFF.

B1 and B1 are the two sides of the button switch. Hook those up like a button switch. Typically connect the switch between a digital input pin and +5V. Connect the digital input pin to Ground with a 1K to 10K pull-down resistor. When the switch is OPEN the pin will read as LOW. When the switch is CLOSED the pin will read as HIGH.

Thanks for the info. The LED is clear now, but I still don't understand where should B1 and B2 go:

Typically connect the switch between a digital input pin and +5V. Connect the digital input pin to Ground with a 1K to 10K pull-down resistor.

I'm not sure I understand - which one goes to the digital pin and which one to the ground?

B1 goes to the pin and B2 goes to +5. Or B2 goes to the pin and B1 goes to +5. Unlike a diode, current can go either way through a switch with equal effect.

The pin is also connected to Ground through a resistor to keep the pin from 'floating' and giving random results.

Thanks! It works!

:astonished: