Skip to content

Instantly share code, notes, and snippets.

@wjessop

wjessop/piglow.go

Created Sep 3, 2013
Embed
What would you like to do?
package main
import (
"github.com/wjessop/go-piglow"
"log"
)
func main() {
var p *piglow.Piglow
var err error
// Create a new Piglow
p, err = piglow.NewPiglow(); if err != nil {
log.Fatal("Couldn't create a Piglow: ", err)
}
p.SetLED(0, 255) // Set LED 0 to 255 (max brightness)
p.SetLED(1, 128) // Set LED 1 to half brightness
err = p.Apply(); if err != nil { // Apply the changes
log.Fatal("Couldn't apply changes: ", err)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment