{"id":18871215,"url":"https://github.com/sanko/rpi-unicornhathd","last_synced_at":"2026-05-19T10:07:46.696Z","repository":{"id":56838483,"uuid":"104793816","full_name":"sanko/RPi-UnicornHatHD","owner":"sanko","description":"Perl wrapper for the Unicorn Hat HD by Pimoroni","archived":false,"fork":false,"pushed_at":"2020-01-02T00:00:44.000Z","size":31,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-31T00:12:50.321Z","etag":null,"topics":["gpio","led-matrix-displays","perl","pimoroni","pimoroni-unicorn-hat-hd","raspberry-pi","rpi","spi","unicorn-hat-hd"],"latest_commit_sha":null,"homepage":"https://metacpan.org/pod/RPi::UnicornHatHD","language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sanko.png","metadata":{"files":{"readme":"README.md","changelog":"Changes","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"sanko","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2017-09-25T19:36:58.000Z","updated_at":"2024-06-27T23:41:26.000Z","dependencies_parsed_at":"2022-08-28T23:12:36.589Z","dependency_job_id":null,"html_url":"https://github.com/sanko/RPi-UnicornHatHD","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanko%2FRPi-UnicornHatHD","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanko%2FRPi-UnicornHatHD/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanko%2FRPi-UnicornHatHD/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanko%2FRPi-UnicornHatHD/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sanko","download_url":"https://codeload.github.com/sanko/RPi-UnicornHatHD/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239818901,"owners_count":19702235,"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":["gpio","led-matrix-displays","perl","pimoroni","pimoroni-unicorn-hat-hd","raspberry-pi","rpi","spi","unicorn-hat-hd"],"created_at":"2024-11-08T05:24:52.206Z","updated_at":"2026-05-19T10:07:46.662Z","avatar_url":"https://github.com/sanko.png","language":"Perl","funding_links":["https://github.com/sponsors/sanko"],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/sanko/RPi-UnicornHatHD.svg?branch=master)](https://travis-ci.org/sanko/RPi-UnicornHatHD) [![MetaCPAN Release](https://badge.fury.io/pl/RPi-UnicornHatHD.svg)](https://metacpan.org/release/RPi-UnicornHatHD)\n# NAME\n\nRPi::UnicornHatHD - Use Pimoroni's Awesome Unicorn HAT HD in Perl\n\n# SYNOPSIS\n\n```perl\n    use RPi::UnicornHatHD;\n    my $display = RPi::UnicornHatHD-\u003enew();\n    while (1) { # Mini rave!\n            $display-\u003eset_all(sprintf '#%06X', int rand(hex 'FFFFFF'));\n            for (0 .. 100, reverse 0 .. 100) {\n                    $display-\u003ebrightness($_ / 100);\n                    $display-\u003eshow();\n            }\n    }\n```\n\n# DESCRIPTION\n\nPimoroni's Unicorn HAT HD crams 256 RGB LEDs, in a 16x16 matrix, onto a single HAT for your Raspberry Pi. Use it for scrolling news or stock quotes. Mount it somewhere as a mood light. Build a binary clock. Uh. I don't know, you'll think of something.\n\n# METHODS\n\nUse these to make pretty pictures.\n\n## `new()`\n\n```\n    $display = RPi::UnicornHatHD-\u003enew();\n```\n\nCreates a new object representing your Unicorn Hat HD. Obviously.\n\n## `brightness($b)`\n\n```\n    $display-\u003ebrightness(.25); # For tinkering at 1a\n```\n\nSet the display brightness between `0.0` and `1.0`. The default is `0.5`.\n\n## `clear()`\n\n```\n    $display-\u003eclear;\n```\n\nClears the display matrix.\n\nThis does not clear the display; it simply resets the 'canvas' for you.\n\n## `get_pixel($x, $y)`\n\n```perl\n    my ($r, $g, $b) = $display-\u003eget_pixel(10, 15);\n```\n\nReturns the color this pixel will display.\n\n## `off()`\n\n```\n    $display-\u003eoff;\n```\n\nClears the display matrix and immediately updates the Unicorn Hat HD.\n\nThis turns off all the pixels.\n\n## `rotation($r)`\n\n```\n    $display-\u003erotation(180);\n```\n\nSet the display rotation in degrees. Actual rotation will be snapped to the\nnearest 90 degrees.\n\n## `set_all($r, $g, $b)`\n\n```\n    $display-\u003eset_all(0xFF, 0, 0);\n    $display-\u003eset_all('#FF0000');\n```\n\nTurns the entire display a single color.\n\nEither...\n\n```\n    $r = Amount of red from 0 to 255\n    $g = Amount of green from 0 to 255\n    $b = Amount of blue from 0 to 255\n```\n\n...or...\n\n```\n    $h = Hex triplet from #000000 to #FFFFFF\n```\n\n## `set_pixel($x, $y, $r, $g, $b)`\n\n```perl\n    for my $x (1..10) {\n            $display-\u003eset_pixel($x, 10, 1, 1, 1);\n    }\n    $display-\u003eset_pixel(0, 0, '#FFF000');\n```\n\nSet a single pixel to RGB color.\n\n```\n    $x = Horizontal position from 0 to 15\n    $y = Vertical position from 0 to 15\n```\n\n...and either...\n\n```\n    $r = Amount of red from 0 to 255\n    $g = Amount of green from 0 to 255\n    $b = Amount of blue from 0 to 255\n```\n\n...or...\n\n```\n    $h = Hex triplet from #000000 to #FFFFFF\n```\n\n## `show()`\n\n```\n    $display-\u003eshow;\n```\n\nOutputs the contents of the matrix buffer to your Unicorn HAT HD.\n\n# SEE ALSO\n\n- Buy one: [http://shop.pimoroni.com/products/unicorn-hat-hd](http://shop.pimoroni.com/products/unicorn-hat-hd)\n- GPIO Pinout: [http://pinout.xyz/pinout/unicorn\\_hat\\_hd](http://pinout.xyz/pinout/unicorn_hat_hd)\n- Github: [https://github.com/sanko/RPi-UnicornHatHD](https://github.com/sanko/RPi-UnicornHatHD)\n\n# LICENSE\n\nCopyright (C) Sanko Robinson.\n\nThis library is free software; you can redistribute it and/or modify\nit under the terms of the Artistic License 2.\n\n# AUTHOR\n\nSanko Robinson \u003csanko@cpan.org\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsanko%2Frpi-unicornhathd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsanko%2Frpi-unicornhathd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsanko%2Frpi-unicornhathd/lists"}