Prompted by a post in a different area of the forum, I offer this info.
The resistor value for an LED is worked out like this:
Supply voltage minus the forward voltage of the LED divided by the LED's working current.
or (Vs - Vf)/If
Vs = Supply voltage
Vf = the voltage drop across the LED
If = the current through the LED in Amps
Red and green LEDs usually have a forward voltage of 2 to 2.5, and white and blue 3 to 4 volts.
For a typical LED (If = 20mA and Vf = 2.5V) to operate from a 12Volt DC supply
R=(12-2.5) / 0.02 = 475 ohm
The nearest standard value resistor is 470 ohm and that would be fine.
Avoid connecting LEDs the wrong way round, as they will be destroyed very quickly.
