08.06.2018, 20:44
(This post was last modified: 08.06.2018, 20:52 by Erwin van der Zwart.)
Hi,
You don't need a script to do that, just use the scene module that is default in the controller.
With script you can use this: (add as event based script to the scene object)
For binary object: (add as event based script to the binary object)
BR,
Erwin
You don't need a script to do that, just use the scene module that is default in the controller.
With script you can use this: (add as event based script to the scene object)
Code:
scenevalue = event.getvalue()
if scenevalue == 1 then
grp.write('1/1/1', 10)
grp.write('1/1/2', true) -- binary
grp.write('1/1/3', 30)
os.sleep(2) -- delay if needed
grp.write('1/1/3', 40)
elseif scenevalue == 2 then
grp.write('1/1/1', 50)
grp.write('1/1/2', false) -- binary
grp.write('1/1/3', 70)
os.sleep(1) -- delay if needed
grp.write('1/1/3', 80)
end
Code:
bitvalue = event.getvalue()
if bitvalue == true then
grp.write('1/1/1', 10)
grp.write('1/1/2', true) -- binary
grp.write('1/1/3', 30)
os.sleep(2) -- delay if needed
grp.write('1/1/3', 40)
else
grp.write('1/1/1', 50)
grp.write('1/1/2', false) -- binary
grp.write('1/1/3', 70)
os.sleep(1) -- delay if needed
grp.write('1/1/3', 80)
end
Erwin