The following matrix describes how the state of the 2 MCU pins will map to the LEDs:
Using two pins independently us to control LEDs 1 through 4; the extra complexity is in controlling LED 5 and 6. By wiring the extra 2 LEDs in opposite polarity between the two MCU pins, when one pin is high and the other low we will turn on LED5, and LED will turn when the pin polarities are flipped. If we stopped there, we would have a problem though. Turning on LED5 would also turn on LED3. We can solve that problem by adding a standard (~0.6v) diode in series with LED3. Using red LEDs with a Vf of 1.8v, a total of 2.4v will be required to turn on LED3, but when LED5 is on there will only be 1.8v. However when the cathode of LED5 is not pulled low, the voltage will rise and turn on LED3. In addition to the schematic I've done a Fritzing breadboard layout for connecting to an MCU.
And here's a video demonstration on a breadboard:
can you post the schematic too, its kind of hard to understand on breadboard for folks like me who are stuck with schematics- Thanks
ReplyDelete