I only have 2 (3-state) pins available on a microcontroller and need to control 3 red LEDs, uC is running on 5V. I can only use passive components in addition.
Answer
To control four LEDs:
simulate this circuit – Schematic created using CircuitLab
To get both LEDs on a particular pin lit, toggle the pin at a few hundred Hz.
Note that this setup requires that the forward voltage of the LEDs be less than Vcc/2.
Note also that the resistors consume power all of the time, not just when the LEDs are on.
No comments:
Post a Comment