EasyManuals Logo

Embedded Systems LogiMachine5 Power User Manual

Embedded Systems LogiMachine5 Power
254 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 #209 background image
209
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

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Embedded Systems LogiMachine5 Power and is the answer not in the manual?

Embedded Systems LogiMachine5 Power Specifications

General IconGeneral
ProcessorARM Cortex-A9
Operating SystemLinux
Memory1GB DDR3
Storage8GB eMMC
Digital I/O16x GPIO
Operating Temperature-20°C to 60°C