Instructables
This is a quick arduino project that is great for beginners. Enjoy! There is a video on the last step!
 
Remove these adsRemove these ads by Signing Up

Step 3: Connect it to the Arduino and Program it!

Wire it up like schematic shows!



After you are done wiring it, you can start programming the arduino. I understand that there are many ways of bumming the code but since this example is for beginners, I made it as simple and understandable as possible.

void setup() {
pinMode(1,OUTPUT);
pinMode(2,OUTPUT);
pinMode(3,OUTPUT);
pinMode(4,OUTPUT);
pinMode(5,OUTPUT);
pinMode(6,OUTPUT);
pinMode(7,OUTPUT);
pinMode(8,OUTPUT);
pinMode(9,OUTPUT);
pinMode(10,OUTPUT);
}
void loop() {
digitalWrite(1,HIGH);
delay(100);
digitalWrite(1,LOW);
digitalWrite(2,HIGH);
delay(100);
digitalWrite(2,LOW);
digitalWrite(3,HIGH);
delay(100);
digitalWrite(3,LOW);
digitalWrite(4,HIGH);
delay(100);
digitalWrite(4,LOW);
digitalWrite(5,HIGH);
delay(100);
digitalWrite(5,LOW);
digitalWrite(6,HIGH);
delay(100);
digitalWrite(6,LOW);
digitalWrite(7,HIGH);
delay(100);
digitalWrite(7,LOW);
digitalWrite(8,HIGH);
delay(100);
digitalWrite(8,LOW);
digitalWrite(9,HIGH);
delay(100);
digitalWrite(9,LOW);
digitalWrite(10,HIGH);
delay(100);
digitalWrite(10,LOW);
}

Step 4: You Are Done!

Picture of You Are Done!
power up your duino' and watch the lights!





MUST READ! :

The first person to make this project and post some images of it in the comments below will receive 1(one) patch acknowledging your accomplishment! Start Building! OFFER VOID PAST January 15, 2012
botgames1 year ago
Mine works! Great instructable! It was an easy build but still pretty cool. And I just LOVE building stuff with LEDS! Thanks
BLias1 year ago
I thought you did a great write up was wondering if you could help me with a project relating to the same thing
TobaTobias2 years ago
Great project! I hope the patch is still on. I made this video:
http://www.youtube.com/watch?v=veTh8TyFa_g&feature=channel_video_title
:)
Robot Lover (author)  TobaTobias2 years ago
Well, I already gave the patch away, but I love it! I will definitely make an exception!
Thanks you very much,
Cheers!
asevilla3 years ago
Cool stuff!

Another way to write the loop would be:

void loop() {
int i = 1;
for (i = 1; i <=10; i++) {
digitalWrite(i,HIGH);
delay(100);
digitalWrite(i,LOW);
}
}

Cheers!
Kind of late reply, I know, but there is a bug in your code. Your output will remain low for about 5 clock cycles. Depending on the speed of your xtal this could be very quick indeed. What you will end up with is the pin going high for 100ms, then going low, then immediately going high again for 100ms. The best you could hope for would be a very slight flicker, probably not discernible. A quick delay(100) after the last digitalWrite(i,LOW); would do the trick. Here is the updated code:

void loop() {
int i = 1;
for (i = 1; i <=10; i++) {
digitalWrite(i,HIGH);
delay(100);
digitalWrite(i,LOW);
delay(100);
}
}
Oh snap! I totally missed that - good call!
Robot Lover (author)  asevilla3 years ago
Yeah I know about that, but it resets after every loop so it kinda delays after each time it goes around. Thanks!
nexekho3 years ago
Could probably do something similar using a cheaper 4017 + 555 combo but pretty nice regardless!
soshimo nexekho3 years ago
Ah, but then you would be stuck with a simple 555 timer and a fixed frequency. With an MCU you have MUCH more power over with what and how you drive your lights. Try making the cylon light programmable (or at least changeable in the sequence). Break out the soldering wick because you are going to be changing your circuit. With an MCU, I hook up my usb, burn my sketch (in the case of a 'duino) and I'm done.
Robot Lover (author)  nexekho3 years ago
Yeah I probably could have but this was mainly a project for beginner arduino users. Thanks for the comment!
You beat me to it, I was going to write an instructable regarding a circular LED chaser for a costume I'm doing (read attempting to do) I may expand on this using shift registers tho.
Robot Lover (author)  Dominion-Network3 years ago
Great! I would love to see it! post an ible! Thanks for the comment!
I have expanded on this using a shift register IC (74HC595) you can read the ible here.
Shift register is a great way to create chaser lights! I've done the same myself. The best part is you can get certain light patterns based on numbers (if you have 8 lights you could think of each as a bit position in a binary number). You can get some really cool chase effects with that. I created a device that allows you to control the sequences from an RS232 port (or USB to RS232 converter). I've used Vixen and created a sequencer plugin for it. All based on that 74HC595!. One thing I ended up doing was add a transistor for each group of eight lights. That acts as a current source so I don't have a current surge nightmare on the 74hc595.
ok i made it. i didnt solder it on a perferbored because i need the leds someware else...
anyway
IMG_0243.jpgIMG_0242.jpg
Robot Lover (author)  RocketPenguin3 years ago
Cool! I'll send the patch right away! You have a video of it in action?
sorry no. but it does the same as yours!
nattyclem3 years ago
I love your triangular LEDs could you tell me where you got them.
Great instructable.
Robot Lover (author)  nattyclem3 years ago
I actually got them off of a broken analog/digital trainer. You could probably do a quick google search for them though. Thanks!
I think I got some in an assorted pak from ebay once :)
Very cool, i would consider maybe incorporating some resistors into it if you decide you want to slow down the chasing speed to save your LED's