Tetris on LEDs

My latest bit of nonsense!

An implementation of Tetris on the Raspberry Pi, but instead of displaying on a screen, all output is via the LEDs of the Ciseco PiLite.

image

If you haven’t got a PiLite, perhaps you’d prefer my alternative version in the Minecraft world?

This is written in python2 and uses my own python-pilite library, available via pip.

I’ve been playing with pygame as well recently, and I’d been thinking for a while that it would be fun to implement a frame-buffer-like interface for the PiLite and a function to write a pygame Surface to it.  That way I could use all of pygame’s sophisticated features, including collision detection.

Overkill on a 14 x 9 x 1-bit display?  Perhaps. Fun though!

As the PiLite is connected via a slow serial link (9600 baud) the rendering is slow, 5 fps, but this is fine for Tetris.

The code is available over on github, along with the PiLite library.

Here’s a poor quality video of it in action!

7 thoughts on “Tetris on LEDs”

  1. Thank you for this, I’ve been looking for something to show off the li-lite using python and this fits the bill perfectly.

    🙂

Leave a Reply

Your email address will not be published. Required fields are marked *