wiremod binary clock

@name Binary Clock
@inputs OsTime
@outputs PM
@outputs Hour1 Hour2 Hour3 Hour4
@outputs Min1 Min2 Min3 Min4 Min5 Min6
@outputs Sec1 Sec2 Sec3 Sec4 Sec5 Sec6
@persist 
@trigger 

local Seconds = OsTime % 60
local Minutes = int(OsTime / 60) % 60
local Hours = int(OsTime / 60 / 60) % 12

Sec1 = Seconds % 2
Sec2 = int(Seconds / 2) % 2
Sec3 = int(Seconds / 4) % 2
Sec4 = int(Seconds / 8) % 2
Sec5 = int(Seconds / 16)% 2
Sec6 = int(Seconds / 32) % 2

Min1 = Minutes % 2
Min2 = int(Minutes / 2) % 2
Min3 = int(Minutes / 4) % 2
Min4 = int(Minutes / 8) % 2
Min5 = int(Minutes / 16)% 2
Min6 = int(Minutes / 32) % 2

Hour1 = Hours % 2
Hour2 = int(Hours / 2) % 2
Hour3 = int(Hours / 4) % 2
Hour4 = int(Hours / 8) % 2

PM = Hours >= 12