dmx: github.com/akualab/dmx Index | Files | Directories

package dmx

import "github.com/akualab/dmx"

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

CREDITS: Ported from pySimpleDMX (https://github.com/c0z3n/pySimpleDMX) Written by Michael Dvorkin

GNU General Public License v3. http://www.gnu.org/licenses/

Index

Package Files

dmx.go

Constants

const (
    START_VAL       = 0x7E
    END_VAL         = 0xE7
    BAUD            = 57600
    TIMEOUT         = 1
    DEV             = "/dev/ttyUSB0"
    FRAME_SIZE      = 511
    FRAME_SIZE_LOW  = byte(FRAME_SIZE & 0xFF)
    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.

Directories

PathSynopsis
example

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