Great stuff. Ok, I’ll give this a go. I’m just trying a vanilla RetroPie image and will try your script and other bits of advice to see if anything works.
Ok, I have just used the vanilla RetroPie image (v2.3) and then ran your install script and everything works fine! The Unicorn Hat is working as expected.
Great news, but also a pain for me - something I have installed has obviously got an issue. Not sure what, but it looks like I may have to reinstall RetroPie from scratch if I want to use the Unicon Hat on my Pi.
I’m going to the last bit of advice you gave before my two replies to see if that fixes it - last chance saloon!
I have now managed to get the Unicorn Hat working with Emulation Station installed. I’m not sure what I did differently, but I can get it to work!
What I now need to figure out is how to get Emulation Station to run a command when I launch a game. The idea being that when I play any NES game, I run sudo python mario.py and then the Unicorn Hat displays the image (based on the show_png.py script) and it displays a custom animation I created which is an 8 x 8 pixel logo of Mario that alternates to Luigi…
If you can’t get emulation station to actively run a script, you could always run another script that polls the process list for each emulator ( might even be able to find the rom that’s been loaded in from the command line ) and updates accordingly.
Something like: ps aux | grep dgen
Or whatever the emulator binaries are called!
Glad you got it working- I’ve had plenty of problems I’ve fixed without quite figuring out how.
Does it not work if you use: “sudo python yourfile.py” ?
The method UnicornHat uses to actually drive the pixels involves some low-level memory twiddling that only the root user has access to. It’s a bit of a hassle, but there’s currently no way around it.