LED

LED comes from  “light-emitting diode”. LEDs have two legs, one positive (anode) which is usually the longer one, and one negative (cathode) which is usually the shorter leg.

As a type of diode, an LED only allows electricity to flow in a certain direction, from the anode to the cathode. Good news is that nothing bad should happen if you don’t know which side is which, because current only flows one way. In other words, if you invert the position, it will simply not light up because there would be no electricity at all running through it. There is, however, the possibility of burning the LED in case you don’t use a proper resistor to limit the current flowing through it.

You will normally connect the positive leg of an LED to a resistor and the negative leg to GND. The resistor, then, connects to the power source or output pin that will control the LED.

For the majority of digital circuits (operating with 5V or 3.3V), LEDs should be OK with resistors varying from 220 ohm up to 1k ohm, which will result in varying levels of luminescence. You can start with a 330 ohm resistor to be on the safe side, then try different resistors to see what works best (there’s a way to calculate the exact amount of resistance needed for that particular circuit, but we’re not doing that :P)

For detailed information about LEDs, check this excellent material from Sparkfun.