Well, recently (early October) I managed to get my hands on an Arduino Uno board and just yesterday got all the parts needed for circuit stuff.

Already I've used my infinte genius to light up, not one, but TWO, count em, TWO, LEDs

All kidding aside, I guess the area to start is: I have a bicolor LED with two legs and I'm confused on how exactly I can use it. Schematics and whatnot would be great for helping me understand more.
You essentially need the equivalent of an H-Bridge. Or, you could go with an even simpler solution, like this one: Propeller Forum solution for driving a bicolor LED. Only issue is that the LED can only be driven as color 1 or color 2, not the trio of states {color 1, color 2, off}.
Bicolour LEDs are actually two LEDs in one package (excuse the ASCII art):

Code:
```      Red //       .-->|--. A o---+      +---o B       '--|<--'         // Green```

The easiest way to drive them is to connect each pin to an output. (Don't forget a protective current-limiting resistor as per your other LEDs). According to the above diagram if A is high and B is low current flows through the red LED and it lights; if A is low and B is high current flows through the green LED and it lights. Setting both A and B to the same level (low or high) switches both LEDs off.

There is yet another colour to be found - if you very quickly alternate between red and green the LED will appear to be yellow.

Benryves, I worry about how much current the Arduino pins can source and sink with that setup.
KermMartian wrote:
Benryves, I worry about how much current the Arduino pins can source and sink with that setup.

It's fine, I have done it before.
Why worry when it's documented?

Quote:
Each output buffer has symmetrical drive characteristics with both high sink and source capability. The pin driver is strong enough to drive LED displays directly.

Each I/O pin has a maximum rating of 40mA (source or sink) though there is an overall 150mA source and 100mA sink limit for several combinations of grouped I/O pins - consult the above linked datasheet for more specific information!
ah, so basically just reverse the way the current goes through the LED in order to change the color given off?

Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

»
» All times are GMT - 5 Hours

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum