32 light unicorn hat doesn't work

I have a 32 light unicorn hat and raspberry pi 3. The pi has been updated and the relevant unicornhat library downloaded as per the tutorial. Ran simple.py in the terminal window to check the unicorn hat was correctly installed etc and nothing happened. Tried other codes in the folder but so far no lights.

I suspect you mean the Unicorn pHAT? It could be an issue with the soldering of the header if so.

… does the example run without error? How have you installed the library?

Thanks for the speedy reply. I used the curl -sS get.pimoroni.com/unicornhat | bash command in the terminal window.

The example runs without error and ends with exiting cleanly.

I would check that you have nice solid joints on the header, the important points for operation are outlined here:

http://forums.pimoroni.com/t/phat-header-soldering-the-lazy-way/

Hi - resoldered and it works, but only when the programs are run from the terminal window using sudo python ./simple.py not from the python code.

I’m not sure what you mean by ‘not from the python code’… if you mean using Idle then that would be because it isn’t running with sudo privileges, which is required for the unicorn.

Hi sorry - poor choice of words on my part - still new to the pi and Python. You’re right I meant from idle.

You can start Idle from the terminal with

sudo idle

it should then run the scripts too. Not sure it’s as convenient as you are used to, but it might be.