-- download at MT.QZX.COM (pulse-on-clock.lua) -- output is off until a pulse is received on input -- then output turns on for 60s -- on timer is restarted if another pulse arrives while on local o = "a" -- output local i = "c" -- input pulse local c = 6 -- pulse 6 times after input pulse local th = 1 -- on for 1s local tl = 10 -- off for 10s if event.iid == "lo" then port[o] = false mem.c = mem.c - 1 if mem.c > 0 then interrupt(tl, "hi") end elseif event.iid == "hi" then port[o] = true interrupt(th, "lo") elseif event.type == "on" and pin[i] then mem.c = c port[o] = false interrupt(tl, "hi") end