Created
March 13, 2015 02:22
-
-
Save G33kDude/307a3db93dfd29807268 to your computer and use it in GitHub Desktop.
Binary clock
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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