All Projects → boombuler → led

boombuler / led

Licence: MIT license
golang package for some LED HID devices

Programming Languages

go
31211 projects - #10 most used programming language

Package to control USB-LED devices

Supported OS

  • OSX
  • Windows
  • Linux

Supported devices

References

Most of the device control knowledge is taken from the NotifierLight project.

Documentation

See GoDoc

Code example

package main

import (
    "fmt"
    "github.com/boombuler/led"
    "image/color"
    "time"
)

var RED color.RGBA = color.RGBA{0xFF, 0x00, 0x00, 0xFF}

func main() {
    for devInfo := range led.Devices() {
        dev, err := devInfo.Open()
        if err != nil {
            fmt.Println(err)
            continue
        }
        defer dev.Close()
        dev.SetColor(RED)

        time.Sleep(2 * time.Second) // Wait 2 seconds because the device will turn off once it is closed!
    }
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].