Introduction: Follow the Leader LED Display With Arduino

Want to create a crazy flashy thingy?

Well this is the step-to-step guide to do so!

With just a few parts that are pretty common, you can complete this project. Well lets start!

Step 1: Step 1 - Materials and Parts

Materials:

• One arduino uno
• 11-15 pre cut wires
• 9 150 ohm resisters (doesn't have to be 150, just depends on your LED)
• 8 LEDs (preferably red, but you can make them any color you want)
• 1 Breadboard
• 1 Serial communication cable (these are the cables used in most printers in order to send information back and forth between a computer and printer)
• Needle nose pliers (which are optional)

Software:

Depending on what operating system you have, follow these steps:

1. Download the appropriate Arduino software
2. Follow installation instructions
3. Open the Arduino software

And you're done the first step!

Step 2: Step 2 - the Code

This code, once you got everything setup will form a "follow the leader" pattern, where each LED will light up, then get turned off, and the next one will do the same, and so on.

Here is the code. Just copy and paste it into the Arduino software:

void setup()
{
  pinMode(12, OUTPUT); // Sets pins 5-12 as outputs
  pinMode(11, OUTPUT);
  pinMode(10, OUTPUT); 
  pinMode(9, OUTPUT);
  pinMode(8, OUTPUT);
  pinMode(7, OUTPUT);
  pinMode(6, OUTPUT); 
  pinMode(5, OUTPUT);
}
void loop(){
  // Starts the first cycle

  digitalWrite(12, HIGH); //turns on first LED and so on
  digitalWrite(11, LOW);
  digitalWrite(10, LOW);
  digitalWrite(9, LOW);
  digitalWrite(8, LOW);
  digitalWrite(7, LOW);
  digitalWrite(6, LOW);
  digitalWrite(5, LOW);
  delay(100); // Length between the times the LEDs change (you can edit this)
  digitalWrite(10, HIGH);
  digitalWrite(12, LOW);
  digitalWrite(11, LOW);
  digitalWrite(9, LOW);
  digitalWrite(8, LOW);
  digitalWrite(7, LOW);
  digitalWrite(6, LOW);
  digitalWrite(5, LOW);
  delay(100);
  digitalWrite(8, HIGH);
  digitalWrite(12, LOW);
  digitalWrite(11, LOW);
  digitalWrite(10, LOW);
  digitalWrite(9, LOW);
  digitalWrite(7, LOW);
  digitalWrite(6, LOW);
  digitalWrite(5, LOW);
  delay(100);
  digitalWrite(6, HIGH);
  digitalWrite(12, LOW);
  digitalWrite(11, LOW);
  digitalWrite(10, LOW);
  digitalWrite(9, LOW);
  digitalWrite(8, LOW);
  digitalWrite(7, LOW);
  digitalWrite(5, LOW);
  delay(100);
  digitalWrite(5, HIGH);
  digitalWrite(12, LOW);
  digitalWrite(11, LOW);
  digitalWrite(10, LOW);
  digitalWrite(9, LOW);
  digitalWrite(8, LOW);
  digitalWrite(7, LOW);
  digitalWrite(6, LOW);
  delay(100);
  digitalWrite(7, HIGH);
  digitalWrite(12, LOW);
  digitalWrite(11, LOW);
  digitalWrite(10, LOW);
  digitalWrite(9, LOW);
  digitalWrite(8, LOW);
  digitalWrite(6, LOW);
  digitalWrite(5, LOW);
  delay(100);
  digitalWrite(9, HIGH);
  digitalWrite(12, LOW);
  digitalWrite(11, LOW);
  digitalWrite(10, LOW);
  digitalWrite(8, LOW);
  digitalWrite(7, LOW);
  digitalWrite(6, LOW);
  digitalWrite(5, LOW);
  delay(100);
  digitalWrite(11, HIGH);
  digitalWrite(12, LOW);
  digitalWrite(10, LOW);
  digitalWrite(9, LOW);
  digitalWrite(8, LOW);
  digitalWrite(7, LOW);
  digitalWrite(6, LOW);
  digitalWrite(5, LOW);
  delay(100);
  digitalWrite(4, HIGH);
  digitalWrite(12, LOW);
  delay(100);
  digitalWrite(12, HIGH);
  digitalWrite(11, LOW);
  digitalWrite(10, LOW);
  digitalWrite(9, LOW);
  digitalWrite(8, LOW);
  digitalWrite(7, LOW);
  digitalWrite(6, LOW);
  digitalWrite(5, LOW);
  delay(100);
  digitalWrite(10, HIGH);
  digitalWrite(11, LOW);
  digitalWrite(12, LOW);
  digitalWrite(9, LOW);
  digitalWrite(8, LOW);
  digitalWrite(7, LOW);
  digitalWrite(6, LOW);
  digitalWrite(5, LOW);
  delay(100);
  digitalWrite(8, HIGH);
  digitalWrite(11, LOW);
  digitalWrite(10, LOW);
  digitalWrite(9, LOW);
  digitalWrite(7, LOW);
  digitalWrite(6, LOW);
  digitalWrite(5, LOW);
  delay(100);
  digitalWrite(6, HIGH);
  digitalWrite(11, LOW);
  digitalWrite(10, LOW);
  digitalWrite(9, LOW);
  digitalWrite(8, LOW);
  digitalWrite(7, LOW);
  digitalWrite(5, LOW);
  delay(100);
  digitalWrite(5, HIGH);
  digitalWrite(11, LOW);
  digitalWrite(10, LOW);
  digitalWrite(9, LOW);
  digitalWrite(8, LOW);
  digitalWrite(7, LOW);
  digitalWrite(6, LOW);
  delay(100);
  digitalWrite(7, HIGH);
  digitalWrite(11, LOW);
  digitalWrite(10, LOW);
  digitalWrite(9, LOW);
  digitalWrite(8, LOW);
  digitalWrite(6, LOW);
  digitalWrite(5, LOW);
  delay(100);
  digitalWrite(9, HIGH);
  digitalWrite(11, LOW);
  digitalWrite(10, LOW);
  digitalWrite(8, LOW);
  digitalWrite(7, LOW);
  digitalWrite(6, LOW);
  digitalWrite(5, LOW);
  delay(100);
  digitalWrite(11, HIGH);
  digitalWrite(10, LOW);
  digitalWrite(9, LOW);
  digitalWrite(8, LOW);
  digitalWrite(7, LOW);
  digitalWrite(6, LOW);
  digitalWrite(5, LOW);
  delay(100);
  digitalWrite(12 , HIGH);
  digitalWrite(11, LOW);
  digitalWrite(10, LOW);
  digitalWrite(9, LOW);
  digitalWrite(8, LOW);
  digitalWrite(7, LOW);
  digitalWrite(6, LOW);
  digitalWrite(5, LOW);
  delay(100);
  digitalWrite(4, LOW);
  digitalWrite(3, HIGH);
  // repeat
}

Once you got that done, you can press the little "Compile" button at the top-left corner of your display. This will check for any problems. If you get no highlighted text, you are good. If you did, check back to make sure you copied the code properly. 

Step 3: Step 3 - Setup Your LEDs

This step will start you off with hooking up some parts to your Arduino. However, before you do that, you will have to decide how you want your LEDs placed*.

Remember to place the longer ends of the LEDs to the right (which will be the positive side), otherwise this step-to-step guide will just get confusing.

* I recommend that you follow the same pattern as I do, otherwise this will get totally complicated for you, and you will have to change the code.








Step 4: Step 4 - Attaching the Ground to the Breadboard

Hooking up the ground or negative to the breadboard is the 2nd most important part in this project. It is also one of the most easiest.

First, get one of your bigger wires.
Second, plug it into your blue power (which represents Ground) strip on your breadboard.


Third, attach it to the GND part of your Arduino.


And thats it! You hooked up ground to your breadboard!

Step 5: Step 5 - Hooking Up the LEDs

This is the fun part where you hook up the LEDs to the Arduino and ground. However, you will most likely mess up once or two if you are just a beginner, so don't worry - it happens to everyone.


Lets hook up the first LED. My first one will be the one in the top left corner.

This LED will be connected to pin 12 on the Arduino Uno.

First get one of your resisters, and attach it to pin 12.

Secondly, attach the other end to the RIGHT lead of the LED (assuming that it is the positive or longer lead, of that LED. If it isn't or you don't know if it is check if it. The longer one is always positive on this type of LED.)

Third, attach the other lead of the LED to ground or the blue part of the breadboard (the on hooked up to the GND pin on the Arduino) using one of the wires

That's one done!

Now attach all of the other LEDs. Make sure to attach them to the right place (the pictures below will show you where to hook up the resisters attached to each LED to).


Step 6: Step 6 - Uploading and Connecting!

You're almost done! Next plug in you Serial communication into the Arduino and the other end into the computer and then press the "Upload" button at the top-left corner of your computer screen. Wait until the code is fully uploaded and watch that awesome pattern that you just created!.

Congrats your officially done! Your LEDs should be blinking on and off! If they aren't, check your wiring!

If you are a experience programmer with Arduino, you can change the pattern to anything!
Thanks for following this tutorial and please vote for it. I spent a lot of time and effort on it.

PEACE OUT!

Arduino Contest

Participated in the
Arduino Contest