Instructables
Lite Brite pegs look like LED's don't they?  That's what I though the other day after working on an LED cube for a few hours.  I happened to see my daughter's Lite Brite sitting there, and I looked at the pile of LED's on my desk.  What a perfect match!

In this instructable I will show you how to make a Lite Brite clock using a Lite Brite, an Arduino, 46 LED's and a few other miscellaneous parts.

This project is an upper-beginner level project.  The most difficult part of building the Lite Brite clock is the soldering.  The soldering is fairly detailed and intricate.  You can very easily short two leads or two wires together, or break solder joints when you're closing the project up.  You need to be very precise and detailed in your inspection of your work.

The code I wrote is fairly straightforward, and you can either just use my code, or use it as an example to come up with your own.  I don't claim to be a programmer, but i get by.

You can find more about the Lite Brite clock at my blog at http://www.meanpc.com/2012/08/arduino-lite-brite-clock-project_3.html

Ready to build?  Let's go!

I documented nearly the entire build with a video camera and photos.  Watching the video is not necessary if you follow the steps, but it might help you through some tricky parts.  Always be sure to defer to the written instruction when there is a difference.  I changed my mind about several things during the build and they had to be redone - but I left the video intact so you could see the entire process.

 
Remove these adsRemove these ads by Signing Up

Step 1: Parts and Tools

Note:  The parts in the following list have changed since the video was shot.  Use the parts below.

Parts

1 Lite Brite
1 Arduino Uno or equivalent. 
46 LED's - I used 5mm.  Diffused LED's will save you some work.
Twelve 100 ohm 1/4 watt resistors
Hookup wire - 20 or 22 gauge, or both.  For wires connecting to the Arduino, I recommend 20 gauge for a tight fit.
Small perfboard, breadboard or whatever you would like to use to mount the 12 resistors feeding each column of LED's.  I used a small piece of perfboard.
Velcro - applied to the back of the Arduino and perfboard and the inside of the Lite Brite to secure the electronics.
Black construction paper - alternatively, you could use some of the paper that came with the Lite Brite if you still have it.
Solder

Tools
Needle nose pliers
Diagonal cutters
Wire strippers
Scissors
Soldering iron
Multimeter
Sandpaper or sanding block if you don't use diffuse LED's.  I used a 320 grit sanding sponge.
Optional - alligator clips - I found these very helpful when testing the LED matrix.


Step 2: Diffuse the LED's

If you bought diffused LED's, you can skip this step.  If not....

We want to use diffused LED's for a couple of reasons.  If the LED's are clear, they will shine outward instead of just lighting themselves up.  Shining outward will make them too bright and can also illuminate surrounding LED's, which will make it difficult to tell which LED's are actually lit up.  The desired effect is for the LED to glow instead of shine.

Take your sandpaper and vigorously buff the the entire surface of each LED.  The LED should look cloudy all over when you are done.  Please reference the photos and video below to see how it is done and how your finished product should look.  It took me around a half hour to diffuse 46 LED's.  If I had planned properly, I think I would have bought them already diffused - it would have been worth it.



Step 3: Cut construction paper to size

Picture of Cut construction paper to size
If you have the paper that came with the Lite Brite, you can skip this step.

Cut a piece of black construction paper to fit the Lite Brite.


Step 4: Layout and place LED's

Picture of Layout and place LED's
IMG_0760 (1024x688).jpg
IMG_0761 (1024x714).jpg
back.jpg
Now we are going to layout the LED's on our Lite Brite.  I did a quick drawing on the white board that you can see below.  With this design, you will need 13 LED's for each of three numbers, 5 LED's for the one, and two LED's for the colon.

The first step is to use your Lite Brite pegs to figure out how you will position your LED's.

Once you have a very good idea how you will position the LED's, put your black paper in.  Now we will punch holes in every position that an LED will be in.  Use a Lite Brite peg to make the holes.  Be very careful to make sure you are punching holes in the right places.  As you can tell from the picture below, I was not careful enough, and had several mistakes.  I ended up patching these holes with very small pieces of construction paper and glue, and it came out fine.

Once you have all the holes punched, go ahead and stick your first row of LED's in, and splay the leads to hold them in place.

Step 5: How to test your LED's

In the next few steps, we will be soldering our LED's down.  We need to make sure the LED's have the right polarity.  Because we have splayed the leads to hold the LED's in place, it is difficult to identify the short lead, or cathode of the LED.  

To be 100% certain your polarity is correct before you solder, make a quick test setup.  Apply power to the LED using a battery and some alligator clips.  Also, BE SURE TO USE A RESISTOR!, especially if you test with a 9 volt battery or higher.  If you don't believe you need the resistor, watch the video below.

Make dead certain you know the polarity of each LED just before you solder it.  A little bit of extra care now can save a ton of troubleshooting later.

Step 6: Solder the cathodes of each row together

Picture of Solder the cathodes of each row together
jumpers.jpg
Solder the cathodes of each of the five rows together.  The cathode is the short or negative end of the LED. You will end up with 5 rows of cathodes that are all tied together.  For now, do nothing with the anodes.

Some of the cathodes will be too far apart to solder together.  Simply cut and strip some jumper wire for those stretches.  Make a small hook on the end of the wire and the LED lead, then squeeze gently.  This should make it relatively easy to solder the jumpers in.

Step 7: Solder the Anodes

Picture of Solder the Anodes
Time to solder the anodes together.  The anodes are running vertically, and you have 10 columns of anodes to tie together.  I chose to simply strip a piece of hookup wire, make loops in the wire, tighten the loops with my needle nose, then solder.  The anodes were pretty easy compared to the cathodes.  Be very careful not to short the anodes and cathodes together - this could be a real PITA to troubleshoot later.

When you get done, use your LED tester to test each LED, as seen in the video below.

Step 8:

Picture of
hookup_whiteboard.jpg
You will now solder hookup wire to the anodes and cathodes.  Going across the top, you will be soldering 10 hookup wires.  Going down, you will solder hookup wire to the 5 rows of cathodes.  

CAUTION:  Do not hookup the leads to the colon in this step.

The easiest method to connect the wires to the leads is to make a small hook on each, then squeeze them together.  This will hold the joint while you solder.    

How much slack do you need in the wires?  That's up to you really.  The 10 anodes will each be connecting to a perfboard or breadboard where the 100 ohm resistors are.  The 5 cathodes can connect directly to the Arduino.  Be sure to think for a minute how your boards will be laid out.  Also make sure to give yourself plenty of slack to open and close the Lite Brite.

Step 9: Connect hookup wires and resistors to perfboard

Picture of Connect hookup wires and resistors to perfboard
IMG_0861 (1024x838).jpg
This step is relatively straightforward.  Each of the 10 anode hookup wires need to connect to the perfboard, through a 100 ohm resistor, then to another hookup wire on the other side.  You will also  connect the anodes of each of you colons through a 100 ohm resistor.

Before you start soldering, you need to know exactly where your perfboard and Arduino will mount in the case.  Once you decide on location, you will know how long to make the hookup wires.

To connect to the perfboard, just insert the wires and resistors through the top of the board.  (The top of the perfboard does not have the copper pads).  Twist the leads together and solder.  Try to get solder on and across the pads, and not just the leads.  Watch the video carefully for further instruction.  Feel free to cut your perfboard down, like I did in the video.  Be careful though, the perfboard is very brittle.  I would cut it before I did any work in case the board gets ruined.

The first video "Breadboard Fail" can be skipped.  I try to use a breadboard, which would have been faster.  The hookup wire kept coming out and I decided it was too fragile.  So I ripped the wires out and used a perboard instead.





 

Step 10: Connect hookup wires to the Arduino

Picture of Connect hookup wires to the Arduino
IMG_0894 (1024x701).jpg
Carefully strip and connect the hookup wires to the Arduino.  Use the chart below as a reference.  For further reference, you can watch me do it in the video.  Note that the cathodes for the colon are connected to ground and the anodes are connected to digital pins 10 and 11.



Step 11: Preliminary testing

Picture of Preliminary testing
Hookup a USB cable and temporarily close up the case of the Lite Brite.

I quickly wrote this code which will count from 0-9 on all digits, except for the first one of course, which will only light up when displaying a '1'.

Please excuse my un-commented code.  I will come back and comment later, but it should be fairly straightforward and easy to read.

No doubt you will have a short, disconnected wire or something to sort out in this step.


int column[]={0,1,2,3,4,5,6,7,8,9,10,11,12};
int row[] = {14,15,16,17,18};


void setup()
{
  for (int i=0;i<13;i++){
  pinMode(column[i],OUTPUT);
  digitalWrite(column[i],LOW);
  } 
 
  for (int j=0;j<5;j++){
  pinMode(row[j],OUTPUT);
  digitalWrite(row[j],HIGH);
  } 
}
void loop () {

for(int x=0;x<1000;x++){
zero(0);
zero(3);
zero(6);


for(int x=0;x<1000;x++){ 
one(-3);
one(0);
one(3);
one(6);
}
for(int x=0;x<1000;x++){
two(0);
two(3);
two(6);
}
for(int x=0;x<1000;x++){
three(0);
three(3);
three(6);
}
for(int x=0;x<1000;x++){
four(0);
four(3);
four(6);
}
for(int x=0;x<1000;x++){
five(0);
five(3);
five(6);
}
for(int x=0;x<1000;x++){
six(0);
six(3);
six(6);
}
for(int x=0;x<1000;x++){
seven(0);
seven(3);
seven(6);
}

for(int x=0;x<1000;x++){
eight(0);
eight(3);
eight(6);
}

for(int x=0;x<1000;x++){
nine(0);
nine(3);
nine(6);
}




 

}

void allOn(){
  for(int x=0;x<5;x++){
    for(int y=0;y<13;y++){
      digitalWrite(row[x],LOW);
      digitalWrite(column[y],HIGH);
    }
  }
}

void allOff(){
  for(int x=0;x<5;x++){
    for(int y=0;y<13;y++){
      digitalWrite(row[x],HIGH);
      digitalWrite(column[y],LOW);
    }
  }
}

void zero(int x){
  digitalWrite(column[1+x],HIGH);
  digitalWrite(row[0],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[0],HIGH);
 
    digitalWrite(column[2+x],HIGH);
  digitalWrite(row[0],LOW);
  digitalWrite(column[2+x],LOW);
  digitalWrite(row[0],HIGH);
 
    digitalWrite(column[3+x],HIGH);
  digitalWrite(row[0],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[0],HIGH);
 
    digitalWrite(column[3+x],HIGH);
  digitalWrite(row[1],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[1],HIGH);
 
    digitalWrite(column[3+x],HIGH);
  digitalWrite(row[2],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[2],HIGH);
 
    digitalWrite(column[3+x],HIGH);
  digitalWrite(row[3],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[3],HIGH);
 
    digitalWrite(column[3+x],HIGH);
  digitalWrite(row[4],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[4],HIGH);
 
    digitalWrite(column[2+x],HIGH);
  digitalWrite(row[4],LOW);
  digitalWrite(column[2+x],LOW);
  digitalWrite(row[4],HIGH);
 
    digitalWrite(column[1+x],HIGH);
  digitalWrite(row[4],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[4],HIGH);
 
    digitalWrite(column[1+x],HIGH);
  digitalWrite(row[3],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[3],HIGH);
 
    digitalWrite(column[1+x],HIGH);
  digitalWrite(row[2],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[2],HIGH);
 
    digitalWrite(column[1+x],HIGH);
  digitalWrite(row[1],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[1],HIGH);
 
}

void one(int x){
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[0],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[0],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[1],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[1],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[2],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[2],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[3],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[3],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[4],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[4],HIGH);
}

void two(int x){
  digitalWrite(column[1+x],HIGH);
  digitalWrite(row[4],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[4],HIGH);
 
  digitalWrite(column[2+x],HIGH);
  digitalWrite(row[4],LOW);
  digitalWrite(column[2+x],LOW);
  digitalWrite(row[4],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[4],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[4],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[3],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[3],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[2],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[2],HIGH);
 
  digitalWrite(column[2+x],HIGH);
  digitalWrite(row[2],LOW);
  digitalWrite(column[2+x],LOW);
  digitalWrite(row[2],HIGH);
 
  digitalWrite(column[1+x],HIGH);
  digitalWrite(row[2],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[2],HIGH);
 
  digitalWrite(column[1+x],HIGH);
  digitalWrite(row[1],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[1],HIGH);
 
  digitalWrite(column[1+x],HIGH);
  digitalWrite(row[0],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[0],HIGH);
 
  digitalWrite(column[2+x],HIGH);
  digitalWrite(row[0],LOW);
  digitalWrite(column[2+x],LOW);
  digitalWrite(row[0],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[0],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[0],HIGH);
   
}

void three(int x){
  digitalWrite(column[1+x],HIGH);
  digitalWrite(row[4],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[4],HIGH);
 
  digitalWrite(column[2+x],HIGH);
  digitalWrite(row[4],LOW);
  digitalWrite(column[2+x],LOW);
  digitalWrite(row[4],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[4],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[4],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[3],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[3],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[2],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[2],HIGH);
 
  digitalWrite(column[2+x],HIGH);
  digitalWrite(row[2],LOW);
  digitalWrite(column[2+x],LOW);
  digitalWrite(row[2],HIGH);
 
  digitalWrite(column[1+x],HIGH);
  digitalWrite(row[2],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[2],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[1],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[1],HIGH);
 
  digitalWrite(column[1+x],HIGH);
  digitalWrite(row[0],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[0],HIGH);
 
  digitalWrite(column[2+x],HIGH);
  digitalWrite(row[0],LOW);
  digitalWrite(column[2+x],LOW);
  digitalWrite(row[0],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[0],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[0],HIGH);
   
}

void four(int x){
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[0],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[0],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[1],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[1],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[2],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[2],HIGH);
 
  digitalWrite(column[1+x],HIGH);
  digitalWrite(row[3],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[3],HIGH);
 
  digitalWrite(column[1+x],HIGH);
  digitalWrite(row[4],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[4],HIGH);
 
  digitalWrite(column[1+x],HIGH);
  digitalWrite(row[2],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[2],HIGH);
 
  digitalWrite(column[2+x],HIGH);
  digitalWrite(row[2],LOW);
  digitalWrite(column[2+x],LOW);
  digitalWrite(row[2],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[3],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[3],HIGH);
  
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[4],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[4],HIGH);
}

void five(int x){
  digitalWrite(column[1+x],HIGH);
  digitalWrite(row[4],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[4],HIGH);
 
  digitalWrite(column[2+x],HIGH);
  digitalWrite(row[4],LOW);
  digitalWrite(column[2+x],LOW);
  digitalWrite(row[4],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[4],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[4],HIGH);
 
  digitalWrite(column[1+x],HIGH);
  digitalWrite(row[3],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[3],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[2],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[2],HIGH);
 
  digitalWrite(column[2+x],HIGH);
  digitalWrite(row[2],LOW);
  digitalWrite(column[2+x],LOW);
  digitalWrite(row[2],HIGH);
 
  digitalWrite(column[1+x],HIGH);
  digitalWrite(row[2],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[2],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[1],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[1],HIGH);
 
  digitalWrite(column[1+x],HIGH);
  digitalWrite(row[0],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[0],HIGH);
 
  digitalWrite(column[2+x],HIGH);
  digitalWrite(row[0],LOW);
  digitalWrite(column[2+x],LOW);
  digitalWrite(row[0],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[0],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[0],HIGH);
   
}

void six(int x){
  digitalWrite(column[1+x],HIGH);
  digitalWrite(row[4],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[4],HIGH);
 
  digitalWrite(column[2+x],HIGH);
  digitalWrite(row[4],LOW);
  digitalWrite(column[2+x],LOW);
  digitalWrite(row[4],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[4],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[4],HIGH);
 
  digitalWrite(column[1+x],HIGH);
  digitalWrite(row[3],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[3],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[2],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[2],HIGH);
 
  digitalWrite(column[2+x],HIGH);
  digitalWrite(row[2],LOW);
  digitalWrite(column[2+x],LOW);
  digitalWrite(row[2],HIGH);
 
  digitalWrite(column[1+x],HIGH);
  digitalWrite(row[2],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[2],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[1],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[1],HIGH);
 
  digitalWrite(column[1+x],HIGH);
  digitalWrite(row[0],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[0],HIGH);
 
  digitalWrite(column[2+x],HIGH);
  digitalWrite(row[0],LOW);
  digitalWrite(column[2+x],LOW);
  digitalWrite(row[0],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[0],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[0],HIGH);
 
    digitalWrite(column[1+x],HIGH);
  digitalWrite(row[1],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[1],HIGH);
   
}

void seven(int x){
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[0],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[0],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[1],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[1],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[2],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[2],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[3],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[3],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[4],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[4],HIGH);
 
    digitalWrite(column[2+x],HIGH);
  digitalWrite(row[4],LOW);
  digitalWrite(column[2+x],LOW);
  digitalWrite(row[4],HIGH);
 
    digitalWrite(column[1+x],HIGH);
  digitalWrite(row[4],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[4],HIGH);
}

void eight(int x){
  digitalWrite(column[1+x],HIGH);
  digitalWrite(row[0],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[0],HIGH);
 
    digitalWrite(column[2+x],HIGH);
  digitalWrite(row[0],LOW);
  digitalWrite(column[2+x],LOW);
  digitalWrite(row[0],HIGH);
 
    digitalWrite(column[3+x],HIGH);
  digitalWrite(row[0],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[0],HIGH);
 
    digitalWrite(column[3+x],HIGH);
  digitalWrite(row[1],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[1],HIGH);
 
    digitalWrite(column[3+x],HIGH);
  digitalWrite(row[2],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[2],HIGH);
 
    digitalWrite(column[3+x],HIGH);
  digitalWrite(row[3],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[3],HIGH);
 
    digitalWrite(column[3+x],HIGH);
  digitalWrite(row[4],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[4],HIGH);
 
    digitalWrite(column[2+x],HIGH);
  digitalWrite(row[4],LOW);
  digitalWrite(column[2+x],LOW);
  digitalWrite(row[4],HIGH);
 
    digitalWrite(column[1+x],HIGH);
  digitalWrite(row[4],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[4],HIGH);
 
    digitalWrite(column[1+x],HIGH);
  digitalWrite(row[3],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[3],HIGH);
 
    digitalWrite(column[1+x],HIGH);
  digitalWrite(row[2],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[2],HIGH);
 
    digitalWrite(column[1+x],HIGH);
  digitalWrite(row[1],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[1],HIGH);
 
      digitalWrite(column[2+x],HIGH);
  digitalWrite(row[2],LOW);
  digitalWrite(column[2+x],LOW);
  digitalWrite(row[2],HIGH);
 
}

void nine(int x){
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[0],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[0],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[1],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[1],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[2],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[2],HIGH);
 
  digitalWrite(column[1+x],HIGH);
  digitalWrite(row[3],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[3],HIGH);
 
  digitalWrite(column[1+x],HIGH);
  digitalWrite(row[4],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[4],HIGH);
 
  digitalWrite(column[1+x],HIGH);
  digitalWrite(row[2],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[2],HIGH);
 
  digitalWrite(column[2+x],HIGH);
  digitalWrite(row[2],LOW);
  digitalWrite(column[2+x],LOW);
  digitalWrite(row[2],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[3],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[3],HIGH);
  
  digitalWrite(column[2+x],HIGH);
  digitalWrite(row[4],LOW);
  digitalWrite(column[2+x],LOW);
  digitalWrite(row[4],HIGH);
 
    digitalWrite(column[3+x],HIGH);
  digitalWrite(row[4],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[4],HIGH);
 
 
}

Step 12: The Code

Time to program the Arduino.  Feel free to use the code below.  You will first need to download the Time library from http://arduino.cc/playground/Code/Time .  Once downloaded, you will put the Time library into the libraries folder of your Arduino directory.  You will then need to go to Sketch---Import Library---Time to include the Time library in your sketch.

Here's how it works:

1. The individual LED's are turned on by setting the row of the LED to LOW, and the Column of the LED to HIGH.  The trick is that only one LED can be controlled at a time.  If you look at the code, you will see that as soon as an LED is turned on, it is turned off right away.  This works because of our persistence of vision and because the LED's are being switched off and on at a very high rate of speed.  The entire display is getting redrawn on the order of 500 times per second.

2. You will notice that I have the colon dots hooked up to two of the output pins.  Why would I do this when they are always on?  Good question!  It's because if we don't turn the colon dots off and on at the same rate as the rest of the LED's, the colon dots would be about ten times brighter that their neighbors.  I tried using constant power to the dots, and it looked terrible.

3. I wrote a function that draws each digit in the first 7 segment position.  I also made the function so that it would accept an offset parameter.  To write the digit in the first position, the offset is -1.  The third position is +3 and the last position is +6.  My code is probably pretty inefficient, but this part works well.

4. The hour is easy to parse from the timeFormat12() function of the Time.h library.  The only tricky part is getting the two parts of the minutes.  The first digit of the minutes can be obtained from simple integer division by 10.  This will truncate the second digit and only return the ten minute portion.  For example, 59/10=5 in integer division.  For the second digit of the minutes, you use the mod function to return the remained after dividing by 10.  Thus, 59%10 = 9.

5.  I realize the clock code could have been written much more efficiently, and if someone bothers to improve it, I would love to see it done well.  I did the best I could for a guy who is not an engineer or a programmer.  All I can really say about my code is that it appears to work.


#include <Time.h>

int column[]={0,1,2,3,4,5,6,7,8,9,10,11};
int row[] = {14,15,16,17,18};


void setup()
{
  setTime(9,27,0,27,7,2012);
 
  for (int i=0;i<13;i++){
  pinMode(column[i],OUTPUT);
  digitalWrite(column[i],LOW);
  } 
 
  for (int j=0;j<5;j++){
  pinMode(row[j],OUTPUT);
  digitalWrite(row[j],HIGH);
  } 
}
void loop () {

digitalWrite(column[11],HIGH);
digitalWrite(column[12],HIGH);
digitalWrite(column[11],LOW);
digitalWrite(column[12],LOW);

switch (hourFormat12()) {
    case 1:
      one(0);
      break;
    case 2:
      two(0);
      break;
          case 3:
      three(0);
      break;
          case 4:
      four(0);
      break;
          case 5:
      five(0);
      break;
          case 6:
      six(0);
      break;
          case 7:
      seven(0);
      break;
          case 8:
      eight(0);
      break;
          case 9:
      nine(0);
      break;
          case 10:
      one(-3);
      zero(0);
      break;
          case 11:
      one(-3);
      one(0);
      break;
          case 12:
      one(-3);
      two(0);
      break;

  }

switch ((minute()/10)) {
    case 0:
      zero(3);
      break; 
    case 1:
      one(3);
      break;
    case 2:
      two(3);
      break;
     case 3:
      three(3);
      break;
     case 4:
      four(3);
      break;
     case 5:
      five(3);
      break;
  }

switch (minute()%10) {
     case 0:
      zero(6);
      break; 
  case 1:
      one(6);
      break;
    case 2:
      two(6);
      break;
          case 3:
      three(6);
      break;
          case 4:
      four(6);
      break;
          case 5:
      five(6);
      break;
          case 6:
      six(6);
      break;
          case 7:
      seven(6);
      break;
          case 8:
      eight(6);
      break;
          case 9:
      nine(6);
      break;
      // if nothing else matches, do the default
      // default is optional
  }


}

void allOn(){
  for(int x=0;x<5;x++){
    for(int y=0;y<13;y++){
      digitalWrite(row[x],LOW);
      digitalWrite(column[y],HIGH);
    }
  }
}

void allOff(){
  for(int x=0;x<5;x++){
    for(int y=0;y<13;y++){
      digitalWrite(row[x],HIGH);
      digitalWrite(column[y],LOW);
    }
  }
}

void zero(int x){
  digitalWrite(column[1+x],HIGH);
  digitalWrite(row[0],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[0],HIGH);
 
  digitalWrite(column[2+x],HIGH);
  digitalWrite(row[0],LOW);
  digitalWrite(column[2+x],LOW);
  digitalWrite(row[0],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[0],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[0],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[1],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[1],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[2],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[2],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[3],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[3],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[4],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[4],HIGH);
 
  digitalWrite(column[2+x],HIGH);
  digitalWrite(row[4],LOW);
  digitalWrite(column[2+x],LOW);
  digitalWrite(row[4],HIGH);
 
  digitalWrite(column[1+x],HIGH);
  digitalWrite(row[4],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[4],HIGH);
 
  digitalWrite(column[1+x],HIGH);
  digitalWrite(row[3],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[3],HIGH);
 
  digitalWrite(column[1+x],HIGH);
  digitalWrite(row[2],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[2],HIGH);
 
  digitalWrite(column[1+x],HIGH);
  digitalWrite(row[1],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[1],HIGH);
 
}

void one(int x){
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[0],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[0],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[1],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[1],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[2],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[2],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[3],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[3],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[4],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[4],HIGH);
}

void two(int x){
  digitalWrite(column[1+x],HIGH);
  digitalWrite(row[4],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[4],HIGH);
 
  digitalWrite(column[2+x],HIGH);
  digitalWrite(row[4],LOW);
  digitalWrite(column[2+x],LOW);
  digitalWrite(row[4],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[4],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[4],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[3],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[3],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[2],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[2],HIGH);
 
  digitalWrite(column[2+x],HIGH);
  digitalWrite(row[2],LOW);
  digitalWrite(column[2+x],LOW);
  digitalWrite(row[2],HIGH);
 
  digitalWrite(column[1+x],HIGH);
  digitalWrite(row[2],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[2],HIGH);
 
  digitalWrite(column[1+x],HIGH);
  digitalWrite(row[1],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[1],HIGH);
 
  digitalWrite(column[1+x],HIGH);
  digitalWrite(row[0],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[0],HIGH);
 
  digitalWrite(column[2+x],HIGH);
  digitalWrite(row[0],LOW);
  digitalWrite(column[2+x],LOW);
  digitalWrite(row[0],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[0],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[0],HIGH);
   
}

void three(int x){
  digitalWrite(column[1+x],HIGH);
  digitalWrite(row[4],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[4],HIGH);
 
  digitalWrite(column[2+x],HIGH);
  digitalWrite(row[4],LOW);
  digitalWrite(column[2+x],LOW);
  digitalWrite(row[4],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[4],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[4],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[3],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[3],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[2],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[2],HIGH);
 
  digitalWrite(column[2+x],HIGH);
  digitalWrite(row[2],LOW);
  digitalWrite(column[2+x],LOW);
  digitalWrite(row[2],HIGH);
 
  digitalWrite(column[1+x],HIGH);
  digitalWrite(row[2],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[2],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[1],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[1],HIGH);
 
  digitalWrite(column[1+x],HIGH);
  digitalWrite(row[0],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[0],HIGH);
 
  digitalWrite(column[2+x],HIGH);
  digitalWrite(row[0],LOW);
  digitalWrite(column[2+x],LOW);
  digitalWrite(row[0],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[0],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[0],HIGH);
   
}

void four(int x){
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[0],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[0],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[1],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[1],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[2],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[2],HIGH);
 
  digitalWrite(column[1+x],HIGH);
  digitalWrite(row[3],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[3],HIGH);
 
  digitalWrite(column[1+x],HIGH);
  digitalWrite(row[4],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[4],HIGH);
 
  digitalWrite(column[1+x],HIGH);
  digitalWrite(row[2],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[2],HIGH);
 
  digitalWrite(column[2+x],HIGH);
  digitalWrite(row[2],LOW);
  digitalWrite(column[2+x],LOW);
  digitalWrite(row[2],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[3],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[3],HIGH);
  
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[4],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[4],HIGH);
}

void five(int x){
  digitalWrite(column[1+x],HIGH);
  digitalWrite(row[4],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[4],HIGH);
 
  digitalWrite(column[2+x],HIGH);
  digitalWrite(row[4],LOW);
  digitalWrite(column[2+x],LOW);
  digitalWrite(row[4],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[4],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[4],HIGH);
 
  digitalWrite(column[1+x],HIGH);
  digitalWrite(row[3],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[3],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[2],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[2],HIGH);
 
  digitalWrite(column[2+x],HIGH);
  digitalWrite(row[2],LOW);
  digitalWrite(column[2+x],LOW);
  digitalWrite(row[2],HIGH);
 
  digitalWrite(column[1+x],HIGH);
  digitalWrite(row[2],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[2],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[1],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[1],HIGH);
 
  digitalWrite(column[1+x],HIGH);
  digitalWrite(row[0],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[0],HIGH);
 
  digitalWrite(column[2+x],HIGH);
  digitalWrite(row[0],LOW);
  digitalWrite(column[2+x],LOW);
  digitalWrite(row[0],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[0],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[0],HIGH);
   
}

void six(int x){
  digitalWrite(column[1+x],HIGH);
  digitalWrite(row[4],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[4],HIGH);
 
  digitalWrite(column[2+x],HIGH);
  digitalWrite(row[4],LOW);
  digitalWrite(column[2+x],LOW);
  digitalWrite(row[4],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[4],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[4],HIGH);
 
  digitalWrite(column[1+x],HIGH);
  digitalWrite(row[3],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[3],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[2],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[2],HIGH);
 
  digitalWrite(column[2+x],HIGH);
  digitalWrite(row[2],LOW);
  digitalWrite(column[2+x],LOW);
  digitalWrite(row[2],HIGH);
 
  digitalWrite(column[1+x],HIGH);
  digitalWrite(row[2],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[2],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[1],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[1],HIGH);
 
  digitalWrite(column[1+x],HIGH);
  digitalWrite(row[0],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[0],HIGH);
 
  digitalWrite(column[2+x],HIGH);
  digitalWrite(row[0],LOW);
  digitalWrite(column[2+x],LOW);
  digitalWrite(row[0],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[0],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[0],HIGH);
 
  digitalWrite(column[1+x],HIGH);
  digitalWrite(row[1],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[1],HIGH);
   
}

void seven(int x){
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[0],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[0],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[1],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[1],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[2],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[2],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[3],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[3],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[4],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[4],HIGH);
 
  digitalWrite(column[2+x],HIGH);
  digitalWrite(row[4],LOW);
  digitalWrite(column[2+x],LOW);
  digitalWrite(row[4],HIGH);
 
  digitalWrite(column[1+x],HIGH);
  digitalWrite(row[4],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[4],HIGH);
}

void eight(int x){
  digitalWrite(column[1+x],HIGH);
  digitalWrite(row[0],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[0],HIGH);
 
  digitalWrite(column[2+x],HIGH);
  digitalWrite(row[0],LOW);
  digitalWrite(column[2+x],LOW);
  digitalWrite(row[0],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[0],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[0],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[1],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[1],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[2],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[2],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[3],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[3],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[4],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[4],HIGH);
 
  digitalWrite(column[2+x],HIGH);
  digitalWrite(row[4],LOW);
  digitalWrite(column[2+x],LOW);
  digitalWrite(row[4],HIGH);
 
  digitalWrite(column[1+x],HIGH);
  digitalWrite(row[4],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[4],HIGH);
 
  digitalWrite(column[1+x],HIGH);
  digitalWrite(row[3],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[3],HIGH);
 
  digitalWrite(column[1+x],HIGH);
  digitalWrite(row[2],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[2],HIGH);
 
  digitalWrite(column[1+x],HIGH);
  digitalWrite(row[1],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[1],HIGH);
 
  digitalWrite(column[2+x],HIGH);
  digitalWrite(row[2],LOW);
  digitalWrite(column[2+x],LOW);
  digitalWrite(row[2],HIGH);
 
}

void nine(int x){
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[0],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[0],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[1],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[1],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[2],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[2],HIGH);
 
  digitalWrite(column[1+x],HIGH);
  digitalWrite(row[3],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[3],HIGH);
 
  digitalWrite(column[1+x],HIGH);
  digitalWrite(row[4],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[4],HIGH);
 
  digitalWrite(column[1+x],HIGH);
  digitalWrite(row[2],LOW);
  digitalWrite(column[1+x],LOW);
  digitalWrite(row[2],HIGH);
 
  digitalWrite(column[2+x],HIGH);
  digitalWrite(row[2],LOW);
  digitalWrite(column[2+x],LOW);
  digitalWrite(row[2],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[3],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[3],HIGH);
  
  digitalWrite(column[2+x],HIGH);
  digitalWrite(row[4],LOW);
  digitalWrite(column[2+x],LOW);
  digitalWrite(row[4],HIGH);
 
  digitalWrite(column[3+x],HIGH);
  digitalWrite(row[4],LOW);
  digitalWrite(column[3+x],LOW);
  digitalWrite(row[4],HIGH);
 
 
}

Step 13: The Finish!

Picture of The Finish!
You should now have a working Lite Brite clock!  You can set the time by changing the values in the line of code that says - setTime(9,27,0,27,7,2012);

Read the Time documentation at Arduino.cc, but the first two numbers of the setTime parameters are hour and minute.

You may or may not be finished with your clock yet.  I attempted to run my clock from a nine volt battery - FAIL.  It didn't even make it 24 hours.  You will either need to use this as a computer desk clock and just leave the clock connected to the USB port of your computer, or you can connect a 7-12 volt wall wart to your board.

If I had it to do over again, I would have used multi-colored diffuse LED's...probably 8mm.

Hope you enjoyed and learned from this instructable.  If any of you have questions or would like to show off your clock, please post them here.

Kasper_448511 months ago

Awesome project! Made mine for a programming class, however there is one thing i recommend: Don't use red LED's they don't show up as nicely as green or yellow. Great instructable!

erezx1 year ago
Thanks a lot for this great tutorial! We made it!
There a couple of things I'd like to share with you from our making experience:
a) We marked the anodes of each led in advance so it was easier not to get mixed up between anodes and cathodes in the soldering process.
b) We discovered an error in the code. The following lines had to be modified for the second colon mark to lite:
digitalWrite(column[11],HIGH);
digitalWrite(column[12],HIGH);
digitalWrite(column[11],LOW);
digitalWrite(column[12],LOW);

Change them to the following, so they correspond to the Arduino wiring as described above:

digitalWrite(column[10],HIGH);
digitalWrite(column[11],HIGH);
digitalWrite(column[10],LOW);
digitalWrite(column[11],LOW);

Great job and thanks again!!
Crusader661 year ago
This is my first project using Arduino and I am quite new on the programming scene. This is a really great instructable and seems to cover all of the details. Although I have encountered a small problem. I can't seem to program my Arduino with the program which you have provided. The Arduino programmer is telling me that certain lines "Aren't declared". As I have said, I've never used Arduino before so I have no idea what this means.
If you could help me out with this problem I would greatly appreciate it.
Hi there, I encountered the same problem. After some looking in the Arduino guide, I found that the Time.h library was copied to the wrong location. Here's a quote from the guide (source: http://arduino.cc/en/Guide/Libraries):
The library won't work if you put the .cpp and .h files directly into the libraries folder or if they're nested in an extra folder. For example:

Documents\Arduino\libraries\ArduinoParty.cpp and
Documents\Arduino\libraries\ArduinoParty\ArduinoParty\ArduinoParty.cpp
won't work.

Hope this helps!
Very awesome i been following your video tut for a while now. I'm also building a clock my self right now just wiring it i finish Soldering the anodes and cathodes now onto the wiring. Soon i hope to be finished and try out the coding on this.
judas792 years ago
I like your project and all the video tutorial. At the beginning of the project you said to pretend it was an Arduino UNO. What would be the code for using the analog inputs on an actual UNO or duemilanove. I asume you would have to change this: int row[] = {14,15,16,17,18};
to something else. I'm a beginner...
meanpc (author)  judas792 years ago
Hi, thanks for the kind words. I'm a beginner too!

The code should work as is. Analog pins A0,A1,A2... can be used as analog or digital pins. You can reference them in your program as either A0,A1.... or as 14,15,16... It will work either way.

You building a clock? If you endup having trouble, drop me a line and I'll take a look.
judas79 meanpc2 years ago
Hi, I got really ambitious after viewing tutorials about circular infinity lights. I want to build a clock that is both.
thanks for your explanation on how to use analogs as digitals. I will have to scavenge for parts.
If i ever get it made I will post some pics.
lol epic music when you were putting the clock down
meanpc (author)  lightning r fun2 years ago
LOL, didn't even notice it! That music was from the opening cermonies of the Olympics.
maclee4real2 years ago
Nice Job, I really enjoyed ur detailed explanations which made the job look very easy.
I think what i really want is a circuit without Arduino, please show us the circuit with complete chips and the programming
meanpc (author)  maclee4real2 years ago
Hi, glad you enjoyed the instructable. The Arduino pin assigments are shown in step 10. Basically, I have the 5 rows of common cathodes going directly to 5 pins on the Arduino. The 10 columns of common anodes each go to a 100 ohm resistor, then to 10 pins on the Arduino.

The code is listed in step 12.

I'm afraid I can't help you with a non-Arduino design - I'm a beginner myself. Are you looking to go with a different micro-controller, or are you just going to do it with IC logic?
binoyxj2 years ago
Looking good. Liked the way you presented the whole project.
meanpc (author)  binoyxj2 years ago
Thanks! Making the Instructable was a lot more work than I though it would be. Very rewarding though.
mikesoniat2 years ago
Very cool! Now what will your daughter play with? ;)
meanpc (author)  mikesoniat2 years ago
Supposed to be buying her a new one - haven't done it yet. :) She better be careful - her Powerwheels is looking like a really solid outdoor robot chassis.
canucksgirl2 years ago
It looks awesome. Well done. :)
meanpc (author)  canucksgirl2 years ago
Thanks!