{"id":15290583,"url":"https://github.com/johnbrainard/unicornhat","last_synced_at":"2025-07-12T11:07:25.004Z","repository":{"id":64298642,"uuid":"89317950","full_name":"JohnBrainard/unicornhat","owner":"JohnBrainard","description":"Unicorn Hat Go API","archived":false,"fork":false,"pushed_at":"2019-12-16T13:29:01.000Z","size":14,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-02T10:51:19.560Z","etag":null,"topics":["pimoroni","raspberry-pi","raspberrypi","unicorn-hat"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JohnBrainard.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-25T04:36:41.000Z","updated_at":"2023-02-21T08:21:56.000Z","dependencies_parsed_at":"2023-01-15T09:01:00.256Z","dependency_job_id":null,"html_url":"https://github.com/JohnBrainard/unicornhat","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/JohnBrainard/unicornhat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohnBrainard%2Funicornhat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohnBrainard%2Funicornhat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohnBrainard%2Funicornhat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohnBrainard%2Funicornhat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JohnBrainard","download_url":"https://codeload.github.com/JohnBrainard/unicornhat/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohnBrainard%2Funicornhat/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264979773,"owners_count":23692496,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["pimoroni","raspberry-pi","raspberrypi","unicorn-hat"],"created_at":"2024-09-30T16:08:41.824Z","updated_at":"2025-07-12T11:07:24.958Z","avatar_url":"https://github.com/JohnBrainard.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# UnicornHat\n\nUnicornHat is a client library for [unicornd][unicornd]\n\n```sh\n$ go get github.com/JohnBrainard/unicornhat\n```\n\n## Example\n\n```go\npackage main\n\nimport (\n\t\"log\"\n\t\"math/rand\"\n\t\"time\"\n\t\"flag\"\n\t\"github.com/JohnBrainard/UnicornHat\"\n)\n\nfunc main() {\n\tr := flag.Uint(\"r\", 0, \"red\")\n\tg := flag.Uint(\"g\", 0, \"green\")\n\tb := flag.Uint(\"b\", 0, \"blue\")\n\n\tclear := flag.Bool(\"clear\", false, \"clear display\")\n\trandom := flag.Bool(\"random\", false, \"random\")\n\n\tflag.Parse()\n\n\tclient, err := unicornhat.Connect()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tif *random {\n\t\trand.Seed(time.Now().UnixNano())\n\n\t\tpixels := [64]unicornhat.Color{}\n\n\t\tfor i := range pixels {\n\t\t\tr := byte(rand.Float32() * 256)\n\t\t\tg := byte(rand.Float32() * 256)\n\t\t\tb := byte(rand.Float32() * 256)\n\n\t\t\tpixels[i] = unicornhat.ColorNew(r, g, b)\n\t\t\tclient.SetAllPixels(pixels)\n\t\t}\n\t} else if *clear {\n\t\tclient.Clear()\n\t} else {\n\t\tpixels := [64]unicornhat.Color{}\n\t\tfor i := range pixels {\n\t\t\tpixels[i] = unicornhat.ColorNew(\n\t\t\t\tbyte(*r),\n\t\t\t\tbyte(*g),\n\t\t\t\tbyte(*b),\n\t\t\t)\n\t\t}\n\t\tclient.SetAllPixels(pixels)\n\t}\n\n\tclient.Show()\n}\n\n```\n\n[unicornd]:https://github.com/pimoroni/unicorn-hat/tree/master/library_c/unicornd","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnbrainard%2Funicornhat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohnbrainard%2Funicornhat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnbrainard%2Funicornhat/lists"}