236
16. DMX interconnection with LM
DMX protocol support is realized upon RS485 serial port.
DMX function
Add the following user library in Scripting
ïƒ
User libraries.
local luadmx =
require('luadmx')
module('DMX', package.seeall)
-- number of calls per second
-- total number of channels to use
-- transition time in seconds, does not include DMX transfer time
function set(chan, val, key)
key = key or defaults.skey
chan = tonumber(chan) or 0
val = tonumber(val) or -1
-- validate channel number and value
if chan >= 1 and chan <= 512 and val >= 0 and val <= 255 then
storage.exec('lset', key, chan - 1, val)
key = key or defaults.skey
chan = tonumber(chan) or 0
-- validate channel number and value
if chan >= 1 and chan <= 512 then
res = storage.exec('lrange', key, chan - 1, chan - 1)
if type(res) == 'table' then