udmx

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 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

Overview

Package udmx provides a minimal insterface for sending DMX messages via a cheap uDMX USB interface.

Supported devices include https://www.amazon.com/dp/B07GT3S6V6 and similar hardware.

Inspired by https://github.com/markusb/uDMX-linux

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Device added in v1.0.0

type Device struct {
	Dev *gousb.Device
}

Device describes a USB-connected uDMX device.

func NewUDMXDevice

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

NewUDMXDevice creates a new uDMX device.

func (*Device) Set added in v1.0.0

func (d *Device) 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