Help us shape the future of Go! Take the 2026 Go Developer Survey

golight

package module
v0.0.0-...-36a92e1 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2017 License: MIT Imports: 3 Imported by: 1

README

golight

A go package for turning a Delcom led light red, green, or yellow.

Installation

This project depends on go.hid which is a wrapper for signal11/hidapi.

To install hidapi:

git clone git@github.com:signal11/hidapi.git
cd hidapi
./bootstrap
./configure

On OSX I found that bootstrap required automake and other packages.

sudo port install automake autoconf libtool

For linux + hidraw: cd linux. (requires libudev. Package libudev-dev on debian/ubuntu.)

For linux + libusb: cd libusb. (requires libusb. Package libusb-1.0-0-dev on debian/ubuntu.)

For mac: cd mac.

For windows: cd windows.

Make and install. For linux/mac:

make
sudo make install

Lastly, for linux only: Create a symlink pointing libhidapi.so to the version you chose:

For linux + hidraw: cd /usr/local/lib; sudo ln -s libhidapi-hidraw.so libhidapi.so

For linux + libusb: cd /usr/local/lib; sudo ln -s libhidapi-libusb.so libhidapi.so

For more instructions on libhidapi, please visit signal11/hidapi.

When you have installed hidapi lib, install go.hid package with go get github.com/GeertJohan/go.hid.

Then install this package with go get github.com/erichhansen/golight

Usage

There are 3 main methods - On, Off, and Flash.

  • On Turn light on
  • Off Turn light off
  • Flash Make light flash

For more information communicating with the delcom light refer the the USB IO HID Datasheet.

Documentation

Index

Constants

View Source
const (
	Green     byte = 0x01
	Red       byte = 0x02
	Yellow    byte = 0x03
	Blue      byte = 0x04
	BlueGreen byte = 0x05
	Purple    byte = 0x06
	White     byte = 0x07
)

colors

Variables

This section is empty.

Functions

func Bootstrap

func Bootstrap()

func Flash

func Flash(color byte)

func Off

func Off(color byte)

func On

func On(color byte)

Types

This section is empty.

Jump to

Keyboard shortcuts

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