Introduction: Led + Arduino "running Light" (very Simple, Good for Beginners)

hello 
so this is my first arduino project. it is very very simple and it is good for beginners
basicly its just leds hooked up in a row to make a running light

Step 1: Materials

-8 x Led (I used 3V Leds because i didnt have 5v ones)
-Arduino
-Breadboard
-Jumper Wires

Optional:
-Prototyping Shield

Step 2: Buiding It

Wire it up following the schematic below.
sorry for the mistake its pin 5 not 7^^

Step 3: The Code

Heres the very basic code:

boolean t = true;
int i = 12;
void setup()
{
  pinMode(12,OUTPUT);
  pinMode(11,OUTPUT);
  pinMode(10,OUTPUT);
  pinMode(9,OUTPUT);
  pinMode(8,OUTPUT);
  pinMode(7,OUTPUT);
  pinMode(6,OUTPUT);
  pinMode(5,OUTPUT);
  pinMode(4,OUTPUT);
}


void loop()
{
  digitalWrite(i,HIGH);
  delay(50);
  digitalWrite(i,LOW);
  if(t == true)
  {
    i = i - 1;
  }
  else
  {
   i = i + 1;
}
if(i < 5)
{
i = 6;
t = false;
}
if(i > 12)
{
i = 11;
t = true;
}


Comments

author
verbanator4351 made it!(author)2014-12-24

This was my first project i made with a kit I got off amazon this christmas. I enjoyed it a lot!

author
STEDMARS made it!(author)2014-10-12

I made it and it was a cool led project

author
D1A9M9O9 made it!(author)2014-02-06

I'd just like to point out that in the code where it says, if(i>5)... well that should be if(i>4)

author
quaddel made it!(author)2013-09-20

thanks^^

author
emikayee made it!(author)2013-09-18

I just wanted to let you know that this was my very first arduino project and I couldn't of picked a better one if I tried!
Super easy and super cool.
So, thank you!

author
slowguy made it!(author)2012-12-15

it is a uno. I just uploaded the program to mine and it works

author
Metaferia made it!(author)2012-12-14

Hi,
I was going to do this as my first project, I went to buy the Arduino but i didn't know which model you were using . Can u pls let me know the Arduino model u used.

thx

author
masprotech made it!(author)2012-04-15

I have been looking for this for a while now...... All others have been over done this is simple and to the point Thanks very much

author
ibecake made it!(author)2011-06-28

Just did this as my first arduino project excellent start big return for small input.
Great Instructible.

author
snotty made it!(author)2011-02-10

Nice easy to understand code. This is great for beginners.

Here's a sneaky trick for your resistor: put one resistor in series with your ground wire on the negative side of your LEDs. This is not going to be good if you reprogram to have all of your LEDs on at once but it's better than nothing. Ideally you'd have one resistor per LED but it's better to have some safety than none.

I blew the USB chip on my Arduino once doing something like this. It was bad news.

Again, nice simple project :)

author
jman+31 made it!(author)2011-02-08

Maybe I am missing something, but shouldn't you have a resistor in series with each of those led's.

author
quaddel made it!(author)2011-02-08

why? because i use 3v ones?

author
frank26080115 made it!(author)2011-02-08

You should always limit current through the LEDs. To prevent damage to the LEDs and prevent damage to your microcontroller pins.

author
jman+31 made it!(author)2011-02-09

Yep frank26080115 is correct. First you will drastically reduce the life of your LED which isn't that big a deal because they are cheap, but the microcontroller would be the big worry. Diodes don't limit current so there is basically just a short to ground. You may get away with it for a while if you are just flashing the LED's, but it will catch up to you eventually. basically any resistor from 470 ohms to 1K should work.

author
quaddel made it!(author)2011-02-09

ok i will change it

author
jman+31 made it!(author)2011-02-09

Definitely keep on experimenting! You will learn as you go and those that have constructive input usually are willing to teach. I learned just about everything I know about electronics through trial and error and input from knowledgeable folks on the internet! :)

author
quaddel made it!(author)2011-02-08

i know but i dont have the correct resistors right now^^

author
Bongmaster made it!(author)2011-02-08

neat :)

author
quaddel made it!(author)2011-02-08

thx

About This Instructable

41,381views

32favorites

License:

More by quaddel:Control Servo with Lightled + arduino "running light" (very simple, good for beginners)Mini Spud Gun (not dangerous)
Add instructable to: