includes go-rpi-rgb-led-matrix as a dep

This commit is contained in:
2023-12-21 11:06:27 -05:00
parent d1d6e2d9f9
commit 4dcea50309
187 changed files with 1174372 additions and 0 deletions
@@ -0,0 +1,39 @@
package main
import (
"flag"
"os"
"time"
"github.com/RockKeeper/go-rpi-rgb-led-matrix"
"github.com/RockKeeper/go-rpi-rgb-led-matrix/rpc"
)
var (
img = flag.String("image", "", "image path")
)
func main() {
f, err := os.Open(*img)
fatal(err)
m, err := rpc.NewClient("tcp", "10.20.20.20:1234")
fatal(err)
tk := rgbmatrix.NewToolKit(m)
close, err := tk.PlayGIF(f)
fatal(err)
time.Sleep(time.Second * 3)
close <- true
}
func init() {
flag.Parse()
}
func fatal(err error) {
if err != nil {
panic(err)
}
}
@@ -0,0 +1,44 @@
package main
import (
"flag"
"github.com/RockKeeper/go-rpi-rgb-led-matrix"
"github.com/RockKeeper/go-rpi-rgb-led-matrix/rpc"
)
var (
rows = flag.Int("led-rows", 32, "number of rows supported")
cols = flag.Int("led-cols", 32, "number of columns supported")
parallel = flag.Int("led-parallel", 1, "number of daisy-chained panels")
chain = flag.Int("led-chain", 2, "number of displays daisy-chained")
brightness = flag.Int("brightness", 100, "brightness (0-100)")
hardware_mapping = flag.String("led-gpio-mapping", "regular", "Name of GPIO mapping used.")
show_refresh = flag.Bool("led-show-refresh", false, "Show refresh rate.")
inverse_colors = flag.Bool("led-inverse", false, "Switch if your matrix has inverse colors on.")
disable_hardware_pulsing = flag.Bool("led-no-hardware-pulse", false, "Don't use hardware pin-pulse generation.")
)
func main() {
config := &rgbmatrix.DefaultConfig
config.Rows = *rows
config.Cols = *cols
config.Parallel = *parallel
config.ChainLength = *chain
config.Brightness = *brightness
config.HardwareMapping = *hardware_mapping
config.ShowRefreshRate = *show_refresh
config.InverseColors = *inverse_colors
config.DisableHardwarePulsing = *disable_hardware_pulsing
m, err := rgbmatrix.NewRGBLedMatrix(config)
fatal(err)
rpc.Serve(m)
}
func fatal(err error) {
if err != nil {
panic(err)
}
}