-- download at MT.QZX.COM (wallclock.lua) -- sends digiline message to 8 digit-*.lua controllers -- ab:cd -- requires an RTC node to get time local s = "a" -- on/off switch local t = 1 -- seconds between updates local rtc = "rtc" -- RTC node channel if event.type == "program" or (event.type == "on" and string.lower(event.pin.name) == s) then mem.t = 0 interrupt(0, "tick") elseif (event.type == "off" and string.lower(event.pin.name) == s) then digiline_send("off", 0) elseif event.iid == "tick" and pin[s] then digiline_send(rtc, "GET") elseif event.channel == rtc then local hours = event.msg * 24 local b = math.floor(hours) local a = math.floor(b/10) b = b%10 hours = (hours%1)*60 local d = math.floor(hours) local c = math.floor(d/10) d = d%10 digiline_send("digit", {a=a, b=b, c=c, d=d}) interrupt(t, "tick") end -- -AA- -- B--C -- B--C -- -DD- -- E--F -- E--F -- -GG- -- 0 0000 ABC-EFG -- 1 0001 --C--F- -- 2 0010 A-CDE-G -- 3 0011 A-CD-FG -- 4 0100 -BCD-F- -- 5 0101 AB-D-FG -- 6 0110 AB-DEFG -- 7 0111 A-C--F- -- 8 1000 ABCDEFG -- 9 1001 ABCD-FG