You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
612 B
Go
33 lines
612 B
Go
package main
|
|
|
|
import (
|
|
"flag"
|
|
|
|
"github.com/mcuadros/go-rpi-rgb-led-matrix"
|
|
"github.com/mcuadros/go-rpi-rgb-led-matrix/rpc"
|
|
)
|
|
|
|
var (
|
|
rows = flag.Int("led-rows", 32, "number of rows supported")
|
|
chain = flag.Int("led-chain", 2, "number of displays daisy-chained")
|
|
brightness = flag.Int("brightness", 100, "brightness (0-100)")
|
|
)
|
|
|
|
func main() {
|
|
config := &rgbmatrix.DefaultConfig
|
|
config.Rows = *rows
|
|
config.ChainLength = *chain
|
|
config.Brightness = *brightness
|
|
|
|
m, err := rgbmatrix.NewRGBLedMatrix(config)
|
|
fatal(err)
|
|
|
|
rpc.Serve(m)
|
|
}
|
|
|
|
func fatal(err error) {
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
}
|