EasyManua.ls Logo

Embedded Systems LM5p-GSMC - Page 240

Default Icon
291 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
240
11.
}
12.
13.
current = 1
14.
end
15.
16.
-- set current scene values
17.
scene = scenes[ current ]
18.
for i, v in ipairs(scene) do
19.
DMX.set(i, v)
20.
end
21.
22.
-- switch to next scene
23.
current = current + 1
24.
if current > #scenes then
25.
current = 1
26.
end
Random scene example
The following example should be placed inside a resident script. Sleep time defines scene keep
time (at least 1 second).
1.
-- number of steps to use, e.g. 3 steps = { 0, 127, 255 }
2.
steps = 5
3.
-- number of channels to set
4.
channels = 3
5.
-- first channel number
6.
offset = 1
7.
8.
for i = offset, channels do
9.
v = math.random(0, (steps - 1)) * 255 / (steps - 1)
10.
DMX.set(i, math.floor(v))
11.
end

Table of Contents

Related product manuals