I had gotten the previous model (which uses 24 red LEDs and one white one for the star) two years ago. https://thepihut.com/products/3d-xmas-t ... spberry-pi. I had lots of fun programming that one to light up in all kinds of patterns. I had some questions and issues which I brought up on this forum at the time.
Initially, I wondered if the previous programs would work on this model, but they don't.
I read through the comments on the PiHut site, and read through the new code on GitHub https://github.com/ThePiHut/rgbxmastree, and fiddled with the new sample programs to vary things, and slowly but finally realized that the new tree is a very different beast.
The old one used up every GPIO pin, one per LED, making it impossible to attach anything else (I particularly wanted to hook up the typical shutdown switch to GPIO3 but couldn't).
The new LEDs (APA102s?) seem to be hooked up in a serial manner like an LED strip, so you need just power, ground, and clock and data pins to control them in an SPI manner. So of course the code would be different, but perhaps GPIO pins are free for other purposes? None of this seems to be documented, so I'm calling out to other tree enthusiasts with more hardware knowledge here...
I used a bright light and a magnifying glass to try to see which pins had traces connected to them, and seemed to find the following physical pins:
- 2 == 5v
6 == GROUND (maybe - not clear)
22 == GPIO 25 (used for clock? )
32 == GPIO 12 (used for data? )
In the GitHub code, there was mention of "mosi_pin=12" and "clock_pin=25", which seems to confirm I have those two right. I'm pretty sure about the power, but wasn't sure about the ground.
I've found references on Adafruit to "hardware SPI" using physical pins 19 and 23 versus using any other GPIO pins for "bit-bang" SPI, supposedly not as fast. https://learn.adafruit.com/adafruit-dot ... cuitpython, So, it would seem that the new sample code is "bit-banging"? I wonder why not use hardware SPI? If we connected the tree to different pins - and changed the code - would that be possible?
The new tree has the same 40-pin female header as the old tree, so it's physically taking up every pin even if its not using them. I tried (very carefully!) to set the tree apart from the pi and just connect the above four pins with MF jumpers, but I didn't get it to work (although I didn't ruin anything either, always a good thing.) If I could figure out which pins were really in use, I could somehow use others for shutdown switches or other purposes.
SO, this is an open invitation to anyone else who has this tree, or anyone else who knows about it, or who knows more about SPI or these LEDs, or the GitHub code, to comment here and enlighten us all.