Hi Arduino Guys,
I am building a Numitron Clock, and what i have left to do is the clock part. I was getting help programing it from a buddy, but he is not available tonight. This following code is what we have so far, and the Time.H Library that is found at http://www.arduino.cc/playground/Code/Time
#include <Time.h>
void setup() {
pinMode(11, OUTPUT);
pinMode(10, OUTPUT);
pinMode(9, OUTPUT);
pinMode(8, OUTPUT);
pinMode(7, OUTPUT);
pinMode(6, OUTPUT);
pinMode(5, OUTPUT);
pinMode(4, OUTPUT);
pinMode(3, OUTPUT);
pinMode(2, OUTPUT);
pinMode(1, OUTPUT);
pinMode(0, OUTPUT);
pinMode(A0, OUTPUT);
pinMode(A1, OUTPUT);
pinMode(A2, OUTPUT);
pinMode(A3, OUTPUT);
Serial.begin(9600);
setTime(1,23,36,22,9,2011);
}
void displaytime(int ht, int ho, int mt, int mo) {
DDRB = B00001111;
DDRC = B00001111;
DDRD = B11111111;
PORTB = 0;
PORTD = 1*16 + 2;
PORTC = 3;
}
void loop() {
int mymin = minute();
int myhour = hour();
int minone = mymin%10;
int minten = (mymin-minone)/10;
int hourone = myhour%10;
int hourten = (myhour-hourone)/10;
Serial.println("Time:");
Serial.println(hourten);
Serial.println(hourone);
Serial.println(minten);
Serial.println(minone);
displaytime(hourten, hourone, minten, minone);
}
The Code above when ported to the clock kinda screws up the display, and i dont really know how to get it to show the time.
I am a programing newb and could use some direction. if more details are needed please ask. ill do the best i can,
PS) Here is an example of a numitron clock if you dont know what a numitron is http://hackadaycom.files.wordpress.com/2011/03/numitron_clock.jpg?w=470&h=353