Nixie Clock ScreenSaver
Posted: Thu Feb 10, 2011 3:35 pm
I recently got an Ardurino and have been looking at some of the cool projects ppl have posted,. when surfing around the net I happened on a site about Nixie tubes,. and thought a clock would be cool. The price of all the gear is a bit much, so I just built a virtual one in ZGE!
I modified the photo from here; http://en.wikipedia.org/wiki/Nixie_tube
Latter I may do the whole thing modeled in 3d ? as even this ver. makes a nice clock that look cool from accross the room.
Anyway the clock code I devised is;
Cheers
Opps! I had a typo,. or a cutNpast-o in there;
This made the digits jump around some,. it is fixed in the attachment.
I modified the photo from here; http://en.wikipedia.org/wiki/Nixie_tube
Latter I may do the whole thing modeled in 3d ? as even this ver. makes a nice clock that look cool from accross the room.
Anyway the clock code I devised is;
Code: Select all
int zH=getSystemTime()/3600;
int zM=getSystemTime()/60-zH*60;
int zS=getSystemTime()-(zH*3600+zM*60);
if (zH>12) zH-=12; //12 or 24 hours
string h=intToStr(zH); if (length(h)<2) h="0"+h;
string m=intToStr(zM); if (length(m)<2) m="0"+m;
string s=intToStr(zS); if (length(s)<2) m="0"+m;
t.text=h+m+s;
Opps! I had a typo,. or a cutNpast-o in there;
Code: Select all
string s=intToStr(zS); if (length(s)<2) m="0"+m;
//from above should have been
string s=intToStr(zS); if (length(s)<2) s="0"+s;
This made the digits jump around some,. it is fixed in the attachment.