loading

This is my first Arduino Project)

i will show simple steps how to make led flag flesher!!

Step 1: Materials

You will need:

Arduino

Breadboard

3x 240ohm resistors

1x Clear Red l.e.d

1x Clear Blue l.e.d

1x Clear Yellow l.e.d

Some Jumper Cables

Step 2: Place Components on Breadboard

Step 3: The Code

The Code is very Simple:

// Project 1 - Flag Flasher

int ledDelay = 50; // delay by 50ms

int spaceDelay=300; //delay by 300ms

int bluePin = 11;

int yellowPin=7;

int redPin = 9;

void setup()

{

pinMode(redPin, OUTPUT);

pinMode(bluePin, OUTPUT);

pinMode(yellowPin,OUTPUT);

}

void loop() {

digitalWrite(bluePin, HIGH); //turn the light on

delay(ledDelay); // wait 50 ms

digitalWrite(bluePin, LOW); //turn the light off

delay(ledDelay); // wait 50 ms

digitalWrite(bluePin, HIGH);

delay(ledDelay); // wait 50 ms

digitalWrite(bluePin, LOW);

delay(ledDelay); // wait 50 ms

delay(spaceDelay); // delay midpoint by 300ms

digitalWrite(yellowPin, HIGH);

delay(ledDelay); // wait 50 ms

digitalWrite(yellowPin, LOW);

delay(ledDelay); // wait 50 ms

digitalWrite(yellowPin, HIGH);

delay(ledDelay); // wait 50 ms

digitalWrite(yellowPin, LOW);

delay(ledDelay); // wait 50 ms

delay(spaceDelay);

digitalWrite(redPin, HIGH);

delay(ledDelay); // wait 50 ms

digitalWrite(redPin, LOW);

delay(ledDelay); // wait 50 ms

digitalWrite(redPin, HIGH);

delay(ledDelay); // wait 50 ms

digitalWrite(redPin, LOW);

delay(ledDelay); // wait 50 ms

delay(spaceDelay);

}

Step 4: Edit and Make Your Code...

you may edit code, add more led's and make the lights flash faster!!

good luck and greetings from MOLDOVA!! ;)

<p>salut vreau sa stiu daca ma poti ajuta<br>am de facut un steag de 12x6 leduri ,ma poti ajuta cu o schema sau ceva?</p>
thanks for the tutorial. I didn't have all of the colored lights you suggested, but it still worked. snapped the picture when the lights were off. doh'eth
<p>VERY NICE. thanks for project</p>
<p>thank you :)))</p>
<p>Well this is a fun little project! Thanks for sharing and welcome to the community!</p>

About This Instructable

3,590views

50favorites

License:

More by A Style Tech:Arduino Photoresistor LED on/off Simple Arduino LED Flag Flasher 
Add instructable to: