Unicorn HAT HD 256 RGB Tutorials



I recently got my Unicorn HAT HD 256 RGB from Pimoroni and I went through some example projects, I must say they are super cool. I am new to Python and have been searching the web for some good tutorials to begin with: Can you guys please guide me and point out few good tutorials to start programming my unicorn Hat HD?

Thank you,


It’s for the original Unicorn HAT, but still applies with a little modification: https://learn.pimoroni.com/tutorial/unicorn-hat/making-rainbows-with-unicorn-hat


Unicorn HAT HD works in basically the same way as both Unicorn HAT and Unicorn pHAT, which just have less LEDs. We’ve got a Getting Started with Unicorn pHAT tutorial that should give you some tips.

But to get you started, if you open a terminal on your Pi and type the following, then it will light the top left LED in white:

import unicornhathd

unicornhathd.set_led(0, 0, 255, 255, 255)

So, the unicornhathd.set_led() function takes the following variables: x, y, r, g, b where x and y are the coordinates of the pixel from the top left corner beginning at 0, 0, and r, g, and b are red, green, and blue values from 0 to 255.

You can set any number of the pixels and then call unicornhathd.show() to push the data to the Unicorn HAT HD and display it. There are some tips in that Unicorn pHAT tutorial on how to use for loops to update groups of pixels all in one go too.

Just let us know if you need any more help, or if you have specific things you’d like to do. :-)


Thank you for the help. I am going to get back on my unicorn HAT HD today again and make some good pixel art.
Just one more quick question: Do I follow the same guidelines from unicorn HAT to light up rows and columns? Maybe draw a diagonal line :)

Thank you once again, Good Day!


Yup, the API of Unicorn HAT HD is basically identical to that of Unicorn HAT- save for the fact it has 16x16 pixels instead of 8x8.



Thank you for all the help. I have been busy with other projects and I will be working again on Unicorn HAT HD.

Good Day,


Just a quick note to say that it’s set_pixel, not set_led - with that minor edit to Sandy’s example above, that script turns on the pixel at the corner closest to the Ethernet port on a Pi 3.

For those already comfortable with programming, there’s a useful reference manual here: