Simple Arduino LED Flag Flasher

4,053

51

4

Published

Introduction: 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

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

2 People Made This Project!

Recommendations

  • Water Contest

    Water Contest
  • Oil Contest

    Oil Contest
  • Clocks Contest

    Clocks Contest

4 Discussions

0
user
Gogu31

2 years ago

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

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