GPIO Xmas Tree for Raspberry Pi

You can read about how to construct the tree and view some sample Python code for driving the it. You can also read about how the Charlieplexing works to drive 7 LEDs from just 4 GPIO pins!

Using your tree with newer RPi models

You may notice that the sample code doesn’t work with the newer Pi models (because it has problems detecting what model they are). For a quick fix, the easiest thing to do is change one line in the file

If you are using a Pi with 40 GPIO pins then change the line:

     if ((revision == “0010”) or (revision == “0012”)):


     if (True):

And you can put False if you are using a 26-pin Pi.

Run a game on your tree

If you didn’t see it last year, do check out Martin O’Hanlon’s excellent Xmas Tree Reaction Game


GPIO Xmas Tree for Raspberry Pi

GPIO Xmas Tree for Raspberry Pi

One thought on “GPIO Xmas Tree for Raspberry Pi

  1. Pingback: We programmed the GPIO Christmas trees | What did we do today?

Comments are closed.