-- download at MT.QZX.COM (delay.lua) local o = "a" -- output local i = "c" -- input local tl = 180 -- wait 180s after input pulse local th = 5 -- then output for 5s if event.type == "on" and pin[i] then port[o] = false interrupt(tl, "hi") elseif event.iid == "hi" then port[o] = true interrupt(th, "lo") elseif event.iid == "lo" then port[o] = false end