3D Xmas Tree for Raspberry Pi

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()
pause()

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.

The Pimoroni Inky pHAT

This tutorial will show you how to install the Pimoroni¬† Inky pHAT Python library, and then walk through its functionality. You’ll learn how to run the a few of the included examples: the calendar and the name badge. For the complete tutorial you can go the the Pimoroni website:

Inky-pHAT1
Inky-pHAT1

https://learn.pimoroni.com/tutorial/sandyj/getting-started-with-inky-phat

Inky-pHAT2
Inky-pHAT2

First thing I did on my Raspberry Pi Zero WH was open a new terminal window and update the software to tun the Pimoroni  Inky pHAT:

sudo pip install –upgrade inkyphat

Inky-pHAT3
Inky-pHAT3

Then I made sure my version of Raspbian was up to date with this command:

sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade

Inky-pHAT4
Inky-pHAT4

Then I the following command to setup the Inky pHAT:

curl https://get.pimoroni.com/inkyphat | bash

Inky-pHAT5
Inky-pHAT5

Once that’s done reboot your Pi to let the changes propagate.

After the reboot open up a terminal window and navigate to:

cd /home/pi/Pimoroni/inkyphat/examples

Once there you can then type “ls” to see the examples in that directory. I did the calendar:

python cal.py

Inky-pHAT6
Inky-pHAT6

Then:

python hello.py “Single-Board.com”

Inky-pHAT7
Inky-pHAT7

Final thoughts:

I am very happy with the completion of this project. It seems that all the soldering I did on the header works as intended. I will update more as I intend to use this Inky pHAT in all of my future projects. I will definitely be adding my logo on there!

What is next weeks project?

Inky-pHAT8

Inky-pHAT8