Skip to content

Instantly share code, notes, and snippets.

@G33kDude
Created March 13, 2015 02:22
Show Gist options
  • Select an option

  • Save G33kDude/307a3db93dfd29807268 to your computer and use it in GitHub Desktop.

Select an option

Save G33kDude/307a3db93dfd29807268 to your computer and use it in GitHub Desktop.
Binary clock
On := "●"
Off := "○"
Blank := " "
Gui, Color, Black
Gui, font, s12 cRed, Courier New
Gui, Add, Text, vDisplay, % MakeDisplay(On, Off, Blank)
Gui, +ToolWindow +E0x40000 +AlwaysOnTop
Gui, Show,, BinClock
SetTimer, UpdateDisplay, 1000
return
UpdateDisplay:
GuiControl, Text, Display, % MakeDisplay(On, Off, Blank)
return
GuiClose:
ExitApp
return
MakeDisplay(On, Off, Blank, Stamp="")
{
FormatTime, T, %Stamp%, HH:mm:ss
T := StrSplit(T), LedMask := 0xFE0FE0FC
Loop, 4
{
y := A_Index, Out .= "`n"
Loop, 8
Out .= !(LedMask & 1<<A_Index*4+y-5) ? Blank : (T[A_Index] & 1<<4-y) ? On : Off
}
return SubStr(Out, 2)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment