Working through some of the examples on github and have more questions than answers with the ubercorn-rainbow-2x1.py example. Link is https://github.com/pimoroni/unicorn-hat-hd/blob/master/examples/ubercorn-rainbow-2x1.py
The example controls two 16x16 unicorns side by side
Of course I can’t make the code work (or I wouldn’t be here)
The documentation I found is http://docs.pimoroni.com/unicornhathd/#porting-from-unicorn-hat
In the code there are three unicornhathd function used that I can’t find documentation for:
-
List item unicornhathd.enable_addressing()
-
List item unicornhathd.setup_buffer(32, 16)
-
List item unicornhathd.setup_display(0, 0, 0, 0)
If I comment out these lines of code and change the x values to 0-15 the rainbow is displayed. (This example is the rainbow.py example with “rappers”)
Assuming I get the software to work the hardware question remains. If I understand SPI correctly to control 2 unicorns, 2 chip select pins are required. Am I correct that Pi header pins 24 and 26 are used? Pin 24 of course works for one Unicorn.
Other than that I am a happy camper. I have enough ideas for the unicorn that 2 would be nice. Four would be great!
Update: I found the Raspberry Pi SPI documentation and my pin out assumption is correct:
The SPI bus is available on the P1 Header:
MOSI P1-19
MISO P1-21
SCLK P1-23 P1-24 CE0
GND P1-25 P1-26 CE1