dmx: Index | Files | Directories

package dmx

import ""

Simple Go package to send DMX messages. Copyright (c) 2013 AKUALAB INC. All Rights Reserved. - @akualab -

CREDITS: Ported from pySimpleDMX ( Written by Michael Dvorkin

GNU General Public License v3.


Package Files



const (
    START_VAL       = 0x7E
    END_VAL         = 0xE7
    BAUD            = 57600
    TIMEOUT         = 1
    DEV             = "/dev/ttyUSB0"
    FRAME_SIZE      = 511
    FRAME_SIZE_HIGH = byte(FRAME_SIZE >> 8 & 0xFF)

type DMX Uses

type DMX struct {
    // contains filtered or unexported fields

A serial DMX connection.

func NewDMXConnection Uses

func NewDMXConnection(device string) (dmx *DMX, err error)

Creates a new DMX connection using a serial device.

func (*DMX) ChannelMap Uses

func (dmx *DMX) ChannelMap(brightness, red, green, blue int)

Convenience method to map colors and brightness to channels.

func (*DMX) ClearAll Uses

func (dmx *DMX) ClearAll()

Turn off all channels.

func (*DMX) ClearChannel Uses

func (dmx *DMX) ClearChannel(channel int) error

Turn off a specific channel.

func (*DMX) Close Uses

func (dmx *DMX) Close() error

Close serial port.

func (*DMX) Render Uses

func (dmx *DMX) Render() error

Send frame to serial device.

func (*DMX) SendRGB Uses

func (dmx *DMX) SendRGB(brightness, red, green, blue byte) (e error)

Configures RGB+Brightness channels and renders the color. Call ChannelMap to configure the RGB channels before calling this method.

func (*DMX) SetChannel Uses

func (dmx *DMX) SetChannel(channel int, val byte) error

Set channel level in the dmx frame to be rendered the next time Render() is called.



Package dmx imports 4 packages (graph) and is imported by 2 packages. Updated 2016-07-17. Refresh now. Tools for package owners.