Geeky JavaScript Binary Clock

15:57.10 - Sunday 9th October 2005   (Link to This Entry)


OK, so we've all seen those Binary Clocks on ThinkGeek but I always felt the design wasn't geeky enough. Why have two columns of LEDs for the hours? It's a single incrementing integar, after all - not two of them!

Nonetheless, it spurred me to write what I consider a proper geek clock in JavaScript. It consists of three lines of 6 'LEDs', so that each line can represent a value from 0 to 63. Granted, this means that the last LED on the 'hour' line (32) will never be used, but you can't have everything. Hell, it would actually save in manufacturing costs if one was ever built since it requires fewer LEDs and less processing.

There are two parts to this - JavaScript and HTML. The JavaScript is as follows: And the HTML (which goes wherever you want the clock to appear) is: You need to add ONLOAD="geektime();" to your BODY tag to start the whole thing off, but that's about it. Your images can be whatever you want - just insert the relevent paths into both the JavaScript and the HTML, and Bob's yer Auntie's live-in lover.

You should be able to see the clock ticking away at the top of this page. How long before some geek with a soldering iron actually makes one?


[ 1 comment pending ]