udmx

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 22, 2023 License: Apache-2.0 Imports: 2 Imported by: 2

README

udmx

udmx provides a Go interface for talking to cheap "udmx" USB-DMX interfaces such as this one.

This was developed using markusb/uDMX-linux as documentation of the interface to udmx devices, but doesn't reuse any of the code.

Example

import (
  "github.com/google/gousb"
  "github.com/scottlaird/udmx"
)

func main() {
  ctx := gousb.NewContext()
  udmx, err := udmx.NewUDMXDevice(ctx)
  if err != nil {
    panic(err)
  }

  // Set DMX device #5 to `17`.
  udmx.Set(5, 17)
}

Disclaimer

This is not an official Google project.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UDMXDevice

type UDMXDevice struct {
	Dev *gousb.Device
}

UDMXDevice describes a USB-connected uDMX device.

func NewUDMXDevice

func NewUDMXDevice(ctx *gousb.Context) (*UDMXDevice, error)

NewUDMXDevice creates a new uDMX device.

func (*UDMXDevice) Set

func (d *UDMXDevice) Set(address, value uint16) error

Set sends a DMX message to `address` with a value of `value`. Generally, this sets a light's brightness, etc to the specified value.

Address is a 1-based user-visible DMX address, even though the DMX wire format is 0-based. To set device #5 to 7, call SetDMX(5, 7)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL