This was a very nice weekend project that I highly recommend that was created by the folks over at the PiHut. I have the working video above showing you how it works, the AsciiCast to show you how to set this up via the command just below this text.
Here is a direct link to the AsciiCast.
As a bonus, I have another video at the extreme bottom that will show you how to do this from the GUI on a Raspberry Pi. So many ways to set this up to cater to all of the different people out there. 🙂
The easiest way to control your 3D Christmas board is with Thonny. This is pre-installed in Raspbian Stretch.
So you can click on the Raspberry icon > Programming > Thonny.
Once Thonny is open paste the following code into it and then click on “Run”
from gpiozero import LEDBoard
from gpiozero.tools import random_values
from signal import pause
tree = LEDBoard(*range(2,28),pwm=True)
for led in tree:
led.source_delay = 0.25
led.source = random_values()
Once you have done that it will prompt you to give the code you just pasted a file name (e.g. xmas.py).
It will save the code as that file name and it will then run the code. You can then start and stop the code as you wish.