Introduction: Arduino Flashing LED Lamp

Picture of Arduino Flashing LED Lamp

A simple RGB LED underglow for a lamp. You can get the lamp from walmart. It has a clear plastic cover for keeping pencils and stuff in it. It is very easy and takes maybe five minutes, but improves the look of room(even though my room is messy)

Step 1: Arduino

Picture of Arduino

Parts:

lamp
arduino uno
9v battery & cord
rgb led
male&female jumper wires

Step 2: Wires

Picture of Wires

Put yellow wire into GND on Arduino, and into v on the RGB. Put the green into pin 13, and into g. Put blue into pin 12 and into b. Put red into pin 11 and into r. If you don't have the same RGB LED as I do, you can just use a bread board, or put the LEDs ends straight into the arduino.

Step 3: Code

Picture of Code

This is the code I used. It is just a blink without delay sketch.

int green = 13; //declare/initialize led colors to their pins
int red = 12;

int blue = 11;

void setup() {

//initialize pins

pinMode(13, OUTPUT);

pinMode(12, OUTPUT);

pinMode(11, OUTPUT);

}

// the loop function runs over and over again forever

void loop() {

digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level)

delay(100);

digitalWrite(13, LOW); // turn the LED off by making the voltage LOW

digitalWrite(12, HIGH); // turn the LED on (HIGH is the voltage level)

delay(100); // wait for a second

digitalWrite(12, LOW); // turn the LED off by making the voltage LOW

digitalWrite(11, HIGH); // turn the LED on (HIGH is the voltage level)

delay(200); // wait for a second

digitalWrite(11, LOW); // turn the LED off by making the voltage LOW

digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level)

delay(100); // wait for a second

digitalWrite(13, LOW); // turn the LED off by making the voltage LOW

digitalWrite(12, HIGH); // turn the LED on (HIGH is the voltage level)

delay(10); // wait for a second

digitalWrite(12, LOW); // turn the LED off by making the voltage LOW

digitalWrite(11, HIGH); // turn the LED on (HIGH is the voltage level)

delay(200); // wait for a second

digitalWrite(11, LOW); // turn the LED off by making the voltage LOW

digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level)

delay(50); // wait for a second

digitalWrite(13, LOW); // turn the LED off by making the voltage LOW

digitalWrite(12, HIGH); // turn the LED on (HIGH is the voltage level)

delay(100); // wait for a second

digitalWrite(12, LOW); // turn the LED off by making the voltage LOW

digitalWrite(11, HIGH); // turn the LED on (HIGH is the voltage level)

delay(20); // wait for a second

digitalWrite(11, LOW); // turn the LED off by making the voltage LOW

digitalWrite(13, HIGH);

delay(1000);

digitalWrite(13, LOW);

digitalWrite(12, HIGH);

delay(10);

digitalWrite(12, LOW);

digitalWrite(11, HIGH);

delay(200);

digitalWrite(11, LOW);

digitalWrite(13, HIGH);

delay(1000);

digitalWrite(13, LOW);

digitalWrite(12, HIGH);

delay(100);

digitalWrite(12, LOW);

digitalWrite(11, HIGH);

delay(2000);

digitalWrite(11, LOW); }

Comments

About This Instructable

488views

7favorites

License:

More by Jaxton Maez:Arduino flashing LED lampEasy RGB LEDMini Pencil
Add instructable to: