Created
September 3, 2013 23:17
-
-
Save wjessop/6430888 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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