Introduction
A Binary clock made in Javascript.
How it Works
Each line match a value : 1, 2, 4, 8.
To read the binary clock, add up columns values to obtain the decimal value.
The Worker
function get the time as ‘ddmmyy’ and ‘hhmmss’ numbers. It converts these 2 numbers to binary arrays (get_binaries) and launch the display function (show_binaries).
The get_binaries
function converts a 6 figures number in an array of 6 arrays. Those arrays are constructed by the get_binary function.
The get_binary
function converts a figure to a 4 binary values array.
The show_binaries
function enable or disable radio elements of the form, depending on the returned array provided by the get_binaries function.
Code
see files here