unicornpaint

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit 5d0a236854dcef596f608c2b7b2dd6197af0efb6
parent 7213657a539c86dccef9446c373ba8a1ba386c20
Author: Martin Ashby <martin@martin-laptop.lan>
Date:   Mon, 21 May 2018 10:34:11 +0100

Merge branch 'master' of github.com:MFAshby/unicornpaint

Diffstat:
MServer.go | 4++--
Aunicorn/README.md | 24++++++++++++++++++++++++
2 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/Server.go b/Server.go @@ -4,14 +4,14 @@ import ( "encoding/json" "fmt" - "github.com/gorilla/websocket" - //"github.com/veandco/go-sdl2/sdl" "io/ioutil" "log" "net/http" "path" "strings" + "github.com/gorilla/websocket" + "github.com/MFAshby/unicornpaint/unicorn" ) diff --git a/unicorn/README.md b/unicorn/README.md @@ -0,0 +1,24 @@ +A go library for interacting with Raspberry Pi Unicorn HAT HD, with a similar API to the official library https://github.com/pimoroni/unicorn-hat-hd + +Includes a simulator when running on amd64 and 386 linux PCs. + +Sample usage: +``` +package main + +import "github.com/MFAshby/unicornpaint/unicorn" + +func main() { + uni, _ := unicorn.GetUnicorn() + defer func() { uni.Off() }() + var x, r, y, g, b uint8 + x = 10 + y = 10 + r = 255 + g = 255 + b = 255 + uni.SetPixel(x, y, r, g, b) + uni.Show() + uni.MainLoop() +} +```