Page 1 of 1

Simple Binary Clock

Posted: Sat Jun 26, 2004 6:10 pm
by Kale
Code updated for 5.20+

A very small snippet i was playing with and thought its quite cute. I may turn it into a full prog with nice UI :) Need to be a geek to read it though. :wink:

Code: Select all

Procedure CalculateTime()
  CurrentDate = Date()
  Hour = Hour(CurrentDate)
  Minute = Minute(CurrentDate)
  Second = Second(CurrentDate)
  ClearConsole()
  Print(RSet(Bin(Hour), 8, "0") + " : " + RSet(Bin(Minute), 8, "0") + " : " + RSet(Bin(Second), 8, "0"))
EndProcedure

OpenConsole()
EnableGraphicalConsole(#True)
CalculateTime()

StartTime = ElapsedMilliseconds()

Repeat
  ElapsedTime = ElapsedMilliseconds()
  
  If (ElapsedTime - StartTime) > 1000
    CalculateTime()
    StartTime = ElapsedMilliseconds()
  EndIf
ForEver

Posted: Mon Jun 28, 2004 6:45 pm
by thefool
If you are going to use this way on a real clock, you need a widescreen led display :)

Sweet.

Posted: Mon Jun 28, 2004 7:43 pm
by PolyVector
http://www.thinkgeek.com/cubegoodies/lights/59e0/

They have watches somewhere too 8)

Posted: Mon Jun 28, 2004 8:06 pm
by thefool
Cool 8)

this thing has nothing to do with a binary clock, but its definantly cool:
http://www.thinkgeek.com/electronics/phones/5c83/