-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding an on command. Restructuring colors
- Loading branch information
Andrew Suderman
committed
Jan 19, 2020
1 parent
97b99d0
commit b338a1b
Showing
4 changed files
with
71 additions
and
24 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package main | ||
|
||
import ( | ||
ws2811 "github.com/rpi-ws281x/rpi-ws281x-go" | ||
) | ||
|
||
// On turns on the lights | ||
func On(colorName string) { | ||
opt := ws2811.DefaultOptions | ||
|
||
opt.Channels[0].Brightness = brightness | ||
opt.Channels[0].LedCount = ledCount | ||
|
||
dev, err := ws2811.MakeWS2811(&opt) | ||
checkError(err) | ||
|
||
cw := &colorWipe{ | ||
ws: dev, | ||
} | ||
checkError(cw.setup()) | ||
defer dev.Fini() | ||
|
||
_ = cw.on(colors[colorName]) | ||
} |
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
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
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