Arduino is a very good programmer and it is also open source(The thing I love about Arduino). We are making a Bi Colour LED to run three colours. You can see the video below on how it works. Enough talk, let's make it!
NOTE: All photos and videos are in HD.
Step 1: Things You Will Need
2. Bi colour LED (http://www.radioshack.com/led): 2.71$
3. Jumper wire(http://www.radioshack.com/Jumper Wire): 5.99$
As my Arduino have male headers, I have to use breadboard and jumper wire. For those who have Arduino with female headers can directly connect LED to thier respective slot.
Step 2: Attaching LED
OK, so attach the RED pin to 9th Digital pin of the Arduino. On Arduino, all digital pins are positive except two last pin after 13th pin.
Attach the green one to 10th and the middle one to Negative also known as GND.
Now building part ends here, attach your Arduino via USB and open your Arduino IDE.
Step 3: Coding
int led = 9;
int leds = 10;
Paste it or type it. After pasting or typing click Upload. Now we are going to understand the code. First we have typed int, means we are making a variable name led of type integer which is on pin 9. Same we are doing with leds but it is on pin 10. We don't need to mention GND. In setup we are registering the variable on our Arduino. In loop, means we are going to run this process infinite times or in simple language in a loop. DigitalWrite means we are giving work to the defined LED. HIGH means ON and LOW means OFF. Delay means for how much time we are going to keep the LED ON or OFF. 1000 means 1 second. First, we ON the Red colour, than ON the green when RED is ON. Than we off the Red colour and then we off the green colour.
See the video below and thanks for seeing my instructable and please vote for me Arduino Contest and sorry for my bad english.