-- download at MT.QZX.COM (pulse-on-rising-edge-when-enabled.lua) local o = "c" -- output pulse local i = "d" -- input signal local s = "b" -- on/off if event.type == "on" and pin[s] and pin[i] and not mem.i then interrupt(1, "lo") port[o] = true mem.i = true elseif event.iid == "lo" then port[o] = false elseif event.type == "off" and mem.i and not pin[i] then mem.i = false end