I’m playing with the UnicornHAT on a Pi 2, after having installed the software via the full install command, and I’ve found the set_all() method doesn’t exist.
Most of the other functions work, and I’m able to get the same effect using the following code, but I doubt this is very efficient:
width, height = unicorn.get_shape()
for y in range(height):
for x in range(width):
unicorn.set_pixel(x, y, rgb['red'], rgb['green'], rgb['blue'])
unicorn.show()
This leads me to think I’ve maybe done something wrong, or the version installed via pip is old. I tried updating the package manually, but that didn’t work either.
I’m pretty new to python, so it’s totally possible that I’m doing something wrong, but I don’t know what.
OK, so I’ve found that you can run the dashboard from the command line via pimoroni-dashboard, so I installed it, run the command, and after exploring the various options (both choosing to install the UnicornHAT, and also checking for updates to the installed libraries), discovered that it’s not doing anything that I’ve not already tried manually.
I think the issue is the version of the library available on pip is out of date.
yes, the installers specifically use the lib considered ‘stable’ i.e available via pip (or apt-get where the case may be), and copies examples to correspond to the point in time that release was made.
That means that you may not have the latest state of the library, and you may be missing some of the additional examples contributed in recent times. The benefit however is that that combination is normally trusted to be working together.
You can install the development version of the library using the setuptools method, but as well as getting potentially some fixes and new functionality, you may also get some bugs (probably hard to track if we did not ran into them with a first pass review).
… all that to say, as long as you know the pitfalls, you can go ahead and use the repo version - after all we do need people to give it a spin at some point - but do keep in mind that you may end up with more trouble, not fewer :)
I was hoping to push a new version up alongside a new rpi_ws281x library that isn’t a hard-forked hack of https://github.com/jgarff/rpi_ws281x but since that repository seems to be neglected at times- it’s had a pending merge from me for Pi Zero W support for 12 days- I might just make a more traditional fork with our own ongoing tweaks/maintenance and release against that.
That said, there may be another option in the pipeline- anyway such shenanigans have left the Unicorn HAT library a little up in the air, and nobody really cares about the plumbing 'til it breaks. It looks like I should release a new version in the interim.