Giter VIP home page Giter VIP logo

golight's Introduction

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 [email protected]: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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.