This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Blink Output LM5R
#3
Add to Common functions:
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
end

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.
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.
Reply


Messages In This Thread
Blink Output LM5R - by Frank68 - 5 hours ago
RE: Blink Output LM5R - by Daniel - 5 hours ago
RE: Blink Output LM5R - by admin - 4 hours ago

Forum Jump: