Unicorn Hat Assistance

Hello all!
I am new to Unicorn and Pi in general. After some time I have managed to put together a damn nice Retropie image and would like to use the Unicorn while I’m playing.

I have managed to run a sample of randon_blinky.py but that is all. I dont know what else to do from there and it seems like there isn’t much information out there for beginners to program the Unicorn. My ultimate goal is to have a “rainbow” that I can control in terms of speed and hue/saturation.

Is there anyone who can point me to, or otherwise educate me in regard to how to code the Unicorn, from start to finish? I can access terminal from my PI, but I have no GUI interface-though I do have a keyboard and a mouse along with Wifi connectivity.

Thanks for the help!

There is this guide here


But you will need to change the uh.set_layout(uh.phat) to uh.set_layout(uh.hat) and in the for loops the number 4’s to 8’s but apart from that that guide should be crosss compatible.

1 Like

This is great! Thanks for sending it to me!

I also penned this guide specifically about how you deal with colour conversion and produce rainbows: https://learn.pimoroni.com/tutorial/unicorn-hat/making-rainbows-with-unicorn-hat