4 hours ago
Add to Common functions:
Create a boolean object and map an event script to it. Set Execution mode to "Last instance only".
0/0/2 is the output control group address.
3 is delay in seconds between each on/off.
Writing true to the event script object will start the blinking. Writing false will stop it and will turn the output off.
Code:
function blink(event, addr, delay)
local obj = grp.find(addr)
if not event.getvalue() then
obj:write(false)
return
end
local value = obj.value
while true do
value = not value
obj:write(value)
os.sleep(delay)
end
endCreate a boolean object and map an event script to it. Set Execution mode to "Last instance only".
0/0/2 is the output control group address.
3 is delay in seconds between each on/off.
Code:
blink(event, '0/0/2', 3)Writing true to the event script object will start the blinking. Writing false will stop it and will turn the output off.