Mini GPIO Xmas Tree

PocketMoneyTronicsSKU: 105319
Price:
Sale price £4
incl. VAT
excl. VAT
Stock:
In stock
Quantity:

Compatible with:

Awesome Extras

The Pi Hut Jumper Bumper Pack (120pcs Dupont Wire) - The Pi HutThe Pi Hut Jumper Bumper Pack (120pcs Dupont Wire) - The Pi Hut
Raspberry Pi 4 Model B Starter KitRaspberry Pi 4 Model B Starter Kit
The Pi HutRaspberry Pi 4 Model B Starter Kit
Sale priceFrom £59.70 incl. VAT excl. VAT
3D RGB Xmas Tree for Raspberry Pi - The Pi Hut3D RGB Xmas Tree for Raspberry Pi - The Pi Hut
The Pi Hut3D RGB Xmas Tree for Raspberry Pi
Sale price £18 incl. VAT excl. VAT
Raspberry Pi Black Design Mug - The Pi HutRaspberry Pi Black Design Mug - The Pi Hut
Raspberry PiRaspberry Pi Black Design Mug
Sale price £9 incl. VAT excl. VAT
Christmas Coding Kit for micro:bit - The Pi HutChristmas Coding Kit for micro:bit - The Pi Hut
ElecfreaksChristmas Coding Kit for micro:bit
Sale price £7.50 incl. VAT excl. VAT

We're stocking this super-cute mini GPIO Xmas Tree for the Raspberry Pi this year as an uber-affordable way to add a little festive fun to your projects, as we all know that December can be expensive enough as it is!

The Mini GPIO Xmas Tree for the Raspberry Pi includes 5 LEDs that can be controlled from a simple Scratch or Python program. When programming your tree, you need to know the GPIO pin number associated with each LED (see below). Setting a GPIO to output high will turn the LED on whilst setting it low will turn it off - easy!

The tree should be connected to the six GPIO pins as shown here. Ensure the LEDs are facing outwards like this:

The GPIO numbers for each LED are as follows:

Works with Scratch!

Do you want to use Scratch 3 to control the LEDs on your tree? If so, click the Add an Extension icon, find Raspberry Pi GPIO and click on it. You can then drag blocks to construct either of the sample programs shown below

Scratch Example 1

Scratch Example 2

Use with Python via Thonny

To control the tree using Python, open Thonny and enter this example code:

from gpiozero import LEDBoard
from time import sleep

tree = LEDBoard(26, 13, 6, 19, 5)

while True:
    
    # illuminate the top and bottom LEDs
    tree.value = (1, 0, 1, 0, 1)
    sleep(0.5)
    
    # illuminate the middle row of LEDs
    tree.value = (0, 1, 0, 1, 0)
    sleep(0.5)

Compatible with Other Dev Boards!

Each LED is wired through a 330-ohm resistor, meaning you can use this with other development boards such as the Raspberry Pi Pico by simply connecting manually with jumper wires to your board's GPIO pins and writing code to control the GPIO pins HIGH/LOW.

Circuit Diagram

Here is the circuit diagram for the tree:

Package Contents

  • 1x Mini GPIO Xmas Tree

Raspberry Pi/wires not included

Payment & Accreditations

Payment methods
Visa Mastercard Maestro PayPal Amazon Klarna

Your payment information is processed securely. We do not store credit card details nor have access to your credit card information.

Accreditations