Instructables

-=!TRI-COLOR LED MOOD-LIGHT!=-

Picture of -=!TRI-COLOR LED MOOD-LIGHT!=-
I like The Arduino a lot so I decided to make a Instructable for a L.E.D. MOOD-LIGHT that goes like this:
Green=on
Yellow=on
red=on
Green=off
Yellow=off
Red=off
And So on.
 
Remove these adsRemove these ads by Signing Up

Step 2: -=Place The LEDS=-

Picture of -=Place The LEDS=-
Put The LEDS onto your breadboard as show in the picture.

Step 3: -=Connect The negative leads=-

Picture of -=Connect The negative leads=-
Connect the negative leads of the LEDs to the negatve rail. 

Step 4: -=Add The Resistors=-

Picture of -=Add The Resistors=-
Add the resistors to the positive leads on the LEDs.

Step 5: -=Connect GND to Negative Rail=-

Picture of -=Connect GND to Negative Rail=-
Connect the GND pin on the Arduino to the negative rail on the Arduino.

Step 6: -=Connect Pin 13=-

Picture of -=Connect Pin 13=-
Connect pin 13 on the  Arduino to one end of the resistor connected to the green Led.

Step 7: -=Connect pin 12=-

Picture of -=Connect pin 12=-
Connect pin 12 on the Arduino to the resistor connected to the yellow Led.

Step 8: -=Connect Pin 8=-

Picture of -=Connect Pin 8=-
Connect pin 8 on the Arduino to the resistor connected to the red Led.

Step 9: -=Get Coding=-

Picture of -=Get Coding=-
This is the Code:
(Made By Me)

Just copy and paste into ARDUINO!

/*
  This Code Is Made By Building_Boy For Instructables.
  It Will Cylcle Through A Red, Green, And Yellow L.E.D.
*/

void setup() {               
//Delcare pinModes
  pinMode(13, OUTPUT);
  pinMode(12, OUTPUT);
  pinMode(8, OUTPUT);
 
}

void loop() {
  digitalWrite(13, HIGH);   //Turn On Green LED
  delay(250);              //Delay
  digitalWrite(12, HIGH);   //Turn On Yellow LED
  delay(250);              //Delay
  digitalWrite(8,HIGH);     //Turn On Red LED
  delay(250);              //Delay
  digitalWrite(13,LOW);     //Turn Off Green LED
  delay(250);              //Delay
  digitalWrite(12,LOW);     //Turn Off Yellow LED
  delay(250);              //Delay
  digitalWrite(8,LOW);      //Turn Off Red LED
  delay(250);              //Delay
}

Step 10: -=How To Change The Speed=-

Picture of -=How To Change The Speed=-
Delays.PNG
To change the speed you need to open the code and change all of the (1000) into smaller numbers (For best effect use 250 on all the delays.

Step 11: -=!DONE!=-

Just Load the Code And You are done!

Now you have a cool mood-light!