Issues with Unicornhat HD and Unicorn Paint



I recently got a Unicorn Hat HD (16x16) and I am having a hard time getting everything to work right. I did get all of the software to download, and the examples to run, but the files that i am making in unicorn paint are not opening once i save them. I downloaded the most recent git hub link, but still nothing happens when i execute the files that i make in unicorn paint. i am using raspbian pixel desktop.

anyone else have experience with this?


The latest code on GitHub should work. I made quite a few changes to it recently to fix some- in retrospect- glaring bugs!

The saved files should look something like this:

#!/usr/bin/env python
import unicornhathd
import signal
pixels = # pixel data here
for x in range(unicornhathd.WIDTH):
    for y in range(unicornhathd.HEIGHT):
        r, g, b = pixels[x][y]
        unicornhathd.set_pixel(x, y, r, g, b)
print("\\nShowing: filename\\nPress Ctrl+C to exit!")

It’s possible that my conversion from pixel data to text is still going wrong. Could you post one of your saves, or upload it to a GitHub gist?

Use three backticks to preserve formatting:

# like so


I will work on that tonight! thanks!


Ok i went back and redownloaded everything. I was able to get everything to work well, the files. I did run into an issue where the paint program would freeze up from time to time, just requires a refresh of the browser.

the new issue that i am running into now, and it is one that i dont know if is really an issue or just how it functions, is that when i attach it to a run command to run when a particular system launches on RetroPie, it takes over the system and does not let the ROM run. With the Blinkt! i had installed previously it would just run the script while the ROM runs.

Is the unicornhat hd not really meant to run in the background while other programs are running?

Sorry for all the questions!


I wonder if that script is supposed to exit- IE: were your Blinkt! scripts running, setting the colour, and then exiting?

Since Unicorn HAT HD does not clear on exit (if I remember correctly) you might just be able to edit your files and remove the line signal.pause() and with any luck it’ll work and not hang your system.


I removed the signal.pause() and it did not run, but it was acting up in general last night so i switched everything back to my Blinkt! I have a new project in mind for the unicorn hat hd that i can dedicate to just using the display as the main function.