I built a 2 x 4 foot LED clock for my wife for Christmas. I used the Seeeduino for the brain, the MAX7221 for the 7 segment driver.
I did a video of the steps as a kind of 1month+ of building in less than 5 minutes viewing type of movie with music.
Thought I would share the results - due to the nature of the finished product, it is hard for me to catch it very well on camera - with the flash on, you see through the frosted front, with the flash off, you miss quite a bit of detail - but at any rate - here it is
Thanks!
The code is really nothing special at this point (outside of the great code already available) - it is this code: http://www.arduino.cc/playground/Main/LedControl#NumberSeg7Control
and this code http://www.arduino.cc/playground/Code/DateTime
munged together. I didnt really do anything special with either piece, but I can clean up the mess and post it if you still want
Was in a time crunch (a few hours before christmas kind of time crunch) so I never cleaned the mess of the code up...
I would love to see your merged code as I have been having a lot of trouble getting my attempt to work properly. I think seeing your effort would be very useful.
Here the code is - not very cleaned up at all
The only thing I would recommend watching out for is the scanlimit section - make sure these settings correspond properly if you use it.
#include <DateTime.h>
#include <DateTimeStrings.h>
//We always have to include the library
#include "LedControl.h"
#define START_TIME 1230393840 // set this to the Unix start time you want (0 is midnight Jan1 1970 UTC)
/* Now we need a LedControl to work with.
***** These pin numbers will probably not work with your hardware *****
pin 12 is connected to the DataIn
pin 11 is connected to the CLK
pin 10 is connected to LOAD
We have only a single MAX72XX.
*/
LedControl lc=LedControl(12,11,10,1);
/* we always wait a bit between updates of the display */
unsigned long delaytime=500;
unsigned long delaytime1=50;
int countones=0;
int counttens=0;
int counthuns=0;
int countthos=0;
byte hours1;
char minutes = '0';
char seconds = '0';
int secondstens = 0;
int secondsones = 0;
int hoursones = 0;
int hourstens = 0;
int minutesones = 0;
int minutestens = 0;
void setup(){
Serial.begin(19200);
DateTime.sync(START_TIME);
/*
The MAX72XX is in power-saving mode on startup,
we have to do a wakeup call
*/
lc.shutdown(0,false);
/* Set the brightness to a medium values */
lc.setIntensity(0,15);
/* and clear the display */
lc.setScanLimit(2,15);
lc.clearDisplay(0);
pinMode (minbutton, INPUT);
pinMode (minbuttonm, INPUT);
pinMode (hourbutton, INPUT);
pinMode (hourbuttonm, INPUT);
}
void loop(){
unsigned long prevtime;
delay(400);
DateTime.available();
showcurtime();
}
void showcurtime(){
byte hours2;
hours1 = 0;
hours1 = (DateTime.Hour);
hours2 = hours24To12(hours1);
hoursones = hours2 % 10;
hourstens = hours2;
if (hourstens > 9) {
hourstens = hourstens / 10;
}
else {
hourstens = 0;
}
secondsones = (DateTime.Second) % 10;
secondstens = (DateTime.Second);
if (secondstens > 9) {
secondstens = secondstens / 10;
}
else {
secondstens = 0;
}
minutesones = (DateTime.Minute) % 10;
minutestens = (DateTime.Minute);
if (minutestens > 9) {
minutestens = minutestens / 10;
}
else {
minutestens = 0;
}
printDigits1(hoursones);
printDigits1(hourstens);
lc.setChar(0,1,minutestens,false);
lc.setChar(0,0,minutesones,false);
lc.setChar(0,2,hoursones,false);
if (hourstens == 0) {
lc.setChar(0,3,'-',false);
}
else lc.setChar(0,3,hourstens,false);
}
byte hours24To12(byte hours){
if( hours == 0 )
return 12; // 12 midnight
else if( hours > 12)
return hours - 12 ;
else
return hours ;
}
I dont have buttons active at this point for the time adjust, I had salvaged some buttons off of some other stuff, and they were bad. So for the time being, I set the START_TIME in code to be current time, and update the system. I have buttons on order - but I am looking at using the metal pieces on the front for touch sensors for time adjust.