??? 01/02/12 16:20 Read: times |
#185266 - Processor can be used Responding to: ???'s previous message |
For most LED, you should get enough light with 1mA current.
Let's assume that your LED needs 2V. The actual voltage depends on color and model but around 2V is close enough for your green LED. If you power your processor with 5V, then you have 3V of "overvoltage" you need to burn over the resistor. U = R * I so R = U / I. R = (5V-2V) / 0.001A = 3/0.001 ohm = 3kohm. So a 3.3kohm resistor should work well. And connect LED in series with resistor between VCC and the processor pin. Draw pin low to turn on the LED, i.e. you get inverted logic. But it is easy for the processor to sink current. |