EasyManuals Logo

Embedded Systems LM5p-GSMC User Manual

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
Page #239 background imageLoading...
Page #239 background image
239
DMX handler script
Add the following resident script with sleep interval = 0, adjust port and channel as needed
1.
if not dmxhandler then
2.
require('user.dmx')
3.
dmxhandler = DMX.init({
4.
port = '/dev/RS485',
-- RS-485 port name
5.
channels = 8,
-- number of DMX channels to use
6.
transition = 2,
-- soft transition time in seconds
7.
})
8.
end
9.
10.
dmxhandler:run()
Setter (used in other scripts)
DMX.set(channel, value)
Mark DMX objects
Create objects with DMX tag, where last part of group address is DMX address (starting from 1).
Create event script mapped to DMX tag.
1.
require('user.dmx')
2.
-- get ID as group address last part (x/y/ID)
3.
id = tonumber(event.dst:split('/')[3])
4.
-- get event value (1 byte scaling)
5.
value = event.getvalue()
6.
-- convert from [0..100] to [0..255]
7.
value = math.floor(value * 2.55)
8.
-- set channel ID value
9.
DMX.set(id, value)
Predefined scene example
The following example should be placed inside a resident script. Sleep time defines scene keep
time (at least 1 second).
1.
if not scenes then
2.
-- 3 channel scene
3.
scenes = {
4.
{ 255, 0, 0 },
5.
{ 0, 255, 0 },
6.
{ 0, 0, 255 },
7.
{ 255, 255, 0 },
8.
{ 0, 255, 255 },
9.
{ 255, 0, 255 },
10.
{ 255, 255, 255 },

Table of Contents

Other manuals for Embedded Systems LM5p-GSMC

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Embedded Systems LM5p-GSMC and is the answer not in the manual?

Embedded Systems LM5p-GSMC Specifications

General IconGeneral
BrandEmbedded Systems
ModelLM5p-GSMC
CategoryDimmer
LanguageEnglish

Related product manuals