binaryclock - showcase for graphical displays of binary clock designs
binaryclock [-v|--version | [-?|-h|--help] | [-d|--debug] | [-c|--commandline] | [-b|--bcd] | [-t|--truebinary]
A binary clock is a clock which displays traditional sexadesimal time in a binary format. There are several ways a binary clock can do it. The two most common ways are implemented here.
In binary-coded decimal (BCD) all six digits of a time stirng HH:MM:SS are individually coded in binary. The arrangements of lights indicating the binary status can be very pleasing to the eye in this model.
The true binary coding creates three binary numbers out of the sexadecimal notation. This leads to larger numbers that are harder to decode.
The graphical display needs installation of perl TK libraries. If they
are missing, command line version of true binary output is used. Note
that you can get the sexadecimal time value printed out using the
--debug option.
v. 0.0 08 Jan 2007, start of the project v. 0.1 18 Jan 2007, working command line version v. 0.2 29 Jan 2007, Binary-coded decimal Tk GUI works v. 0.3 31 Jan 2007, added true decimal display option v. 0.4 04 Feb 2007, added true binary command line display v. 0.5 08 Feb 2007, docs and clean up v. 1.0 21 Feb 2007, first public release
Please report bugs to the author.
You may distribute this program under the same terms as perl itself.
Heikki Lehvaslaiho, heikki lehvaslaiho a gmail com
No input from others so far.
You can get the latest version of this program at http://heikki.lehvaslaiho.googlepages.com/progs
http://en.wikipedia.org/wiki/Binary_clock
The rest of the documentation details each of the subroutines this program is composed of.
Description: print true binary clock to terminal Returns : - Exceptions : - Caller : main()
Description: Initialize non-standard perl modules and fail
gracefully if any of them is missing.
Returns : true on success, false on failing to found Tk
Exceptions : -
Caller : main()
Description: Retrive time string from OS Returns : reference to a hash with keys: h, min, sec Exceptions : - Caller : main() or start() Args : none
Description: Split decimal time value into integers that repesent the
binary values. e.g. 7 = 4 + 2 + 1
Returns : hash reference where binary values are keys
Exceptions : -
Caller : create_binary_mode()
Args : integer number, scalar
Description: split time integer values into binary quivalents
Returns : Hash reference where keys are h, min, sec, and std time.
Keys hold references to hashes where the keys are
decimal components if the corresponding integer. BCD
adds one more layer under times since tens and unary
values are handled separately.
Exceptions : -
Caller : main() or start()
Description: main block of code for graphical display Returns : - Exceptions : - Caller : main()