Sooo… got my daughter a mood light for her birthday. She absolutely loves it!
We did have to substitute in a spare old-style pi zero that I had lying around though. Because when I try to run the unicorn phat from the pi zero w, I get the following error:
Traceback (most recent call last):
File “rainbow.py”, line 6, in
import unicornhat as unicorn
File “/usr/local/lib/python2.7/dist-packages/unicornhat.py”, line 14, in
ws2812.begin()
File “/usr/local/lib/python2.7/dist-packages/neopixel.py”, line 114, in begin
raise RuntimeError(‘ws2811_init failed with code {0}’.format(resp))
RuntimeError: ws2811_init failed with code -1
Exiting cleanly
This was using a freshly-minted raspbian SD card, fully updated, with brand new Pimoroni dashboard installed, and unicorn pHAT support installed via dashboard. Obviously not a problem with the unicorn pHAT, as it works fine on the old pi zero. And just to be sure, I tried it with another unicorn pHAT that I already had (and have used many times), and same error. So… I thought maybe there was a problem with my soldering of the headers on the pi zero w. But I set up a simple circuit with an LED and resistor, and can confirm that the 1st 5V pin works, and BCM 18. (I think these are what the unicorn pHAT uses.)
I’ve just had a look at it again today, and updated and upgraded raspbian (seems quite significant, with added bonus that onboard LED works properly now), but still getting same error with unicorn pHAT. I think it must be something I’m doing, because no one else is reporting these problems, but I’m a a loss as to what it is!
The pi zero w seems to work fine apart from this. I’ve just got a couple of other pHATs today (that were intended for an old pi zero), so may get a chance to test them tomorrow.
Have fun at the big birthday. Wish I was there instead of organising a kid’s birthday!