Introduction: Simple Arduino LED Flag Flasher

Picture of Simple Arduino LED Flag Flasher

This is my first Arduino Project)

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

Step 1: Materials

Picture of 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

Picture of 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!! ;)

Comments

zuhairmohammed made it! (author)2017-10-15

it really work

Gogu31 (author)2016-06-16

salut vreau sa stiu daca ma poti ajuta
am de facut un steag de 12x6 leduri ,ma poti ajuta cu o schema sau ceva?

captainmo69 made it! (author)2015-08-08

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

RayM17 (author)2015-07-29

VERY NICE. thanks for project

A Style Tech (author)2015-05-17

thank you :)))

tomatoskins (author)2015-05-15

Well this is a fun little project! Thanks for sharing and welcome to the community!

About This Instructable

3,752views

51favorites

License:

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