NAME

binaryclock - showcase for graphical displays of binary clock designs


Synopsis

binaryclock [-v|--version | [-?|-h|--help] | [-d|--debug] | [-c|--commandline] | [-b|--bcd] | [-t|--truebinary]


DESCRIPTION

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.

Binary-coded decimal

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.

True binary

The true binary coding creates three binary numbers out of the sexadecimal notation. This leads to larger numbers that are harder to decode.


Requirements

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.


VERSION HISTORY

 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


BUGS

Please report bugs to the author.


LICENSE

You may distribute this program under the same terms as perl itself.


AUTHOR

Heikki Lehvaslaiho, heikki lehvaslaiho a gmail com


CONTRIBUTORS

No input from others so far.


URL

You can get the latest version of this program at http://heikki.lehvaslaiho.googlepages.com/progs


SEE ALSO

http://en.wikipedia.org/wiki/Binary_clock


APPENDIX

The rest of the documentation details each of the subroutines this program is composed of.

print_binary_mode

  Description: print true binary clock to terminal
  Returns    : -
  Exceptions : -
  Caller     : main()

init

  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()

get_time

  Description: Retrive time string from OS
  Returns    : reference to a hash with keys: h, min, sec
  Exceptions : -
  Caller     : main() or start()
  Args       : none

find_binaries

  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

create_binary_mode

  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()

start

  Description: main block of code for graphical display
  Returns    : -
  Exceptions : -
  Caller     : main()