York Hackspace

Tag Archives: Raspberry Pi

Tetris is one of the world’s greatest games. Perhaps one of the reasons Tetris is such a ubiquitous computer game is because you don’t need a particularly high resolution display. You might even say it works better at low resolutions. Perhaps this is what John was thinking when he filled a table with neopixel-like LED strips to create a large low-res display for playing Tetris. If this looks familiar, perhaps you spotted it at the Derby Maker Faire.

John built the table himself from scratch and even gave it York Hackspace branding. He has ten LED strips running the length of the table. They are neopixel-like LEDs which chain together to form a single individually-addressable strip. The ten strips are wired together as one continuous line, snaking its way from one side of the table to the other.

The inside of the table is mostly hollow. The LED strips are stuck to the base and point up towards the perspex lid. To separate the LEDs and make sure that they each illuminate only a small square just above them, John has added a grid of foam walls.

The game is written in python and is running on a Raspberry Pi 2. John’s built a small board with an IO expander for driving the LEDs and reading the buttons.

Of course, there is nothing restricting the table to just running Tetris. At the last hackspace open evening, Nick had a go at writing a snake game. The controls for snake are not so intuitive when you just have four buttons in a straight line, but that adds an element of challenge to it. You can try any of the games or write your own using the tetris table simulator that John wrote as part of this project. All the code for playing in the simulator or on the real hardware is available on github: https://github.com/choffee/tetris_table

Write your own Tetris table games! John will be thrilled to see your pull requests. With potential for two player games, you could get quite creative.

On the subject of creativity, I’ll leave you with this photo of “The Lucky Penny” that definitely isn’t in a hole that was drilled in the wrong place.

Being able to leave equipment permanently in place and attached to the walls or ceiling is a luxury we gained when we moved in to our new space. So naturally enough, when we had a projector and an amplifier system lying around doing nothing, it only made sense to give the space a proper multimedia setup.

We put the projector on the ceiling a little while ago, but hadn’t really connected it up until we got the amp and speakers.

With a little bit of planning followed by shopping for the right cables, we now have a setup that should cater for most circumstances. Our projector can now take HDMI, VGA or Mini Displayport (or anything else you can convert to HDMI) with sound provided via a Cambridge audio A1 mk3 Stereo amplifier.

We can also cast audio to a Raspberry Pi using DLNA. The Pi is connected directly to the amp at the moment and so only does audio, but we plan to get an HDMI switch that will allow us to use the Pi for casting video to the projector without having to sacrifice the wired option.

This solution makes it easy to connect almost any device we need to the system. The long HDMI cable ends at a desk on the other side of the room that is convenient for placing a laptop for showing a video or presentation. As the HDMI cable carries both audio and video, this is the only cable we need going to the projector setup, where a converter box splits the HDMI out to VGA and a pair or RCA connectors for audio. Unfortunately the projector doesn’t have any digital inputs, so we had to go for VGA. The other input options are provided by a kit of converters.

We still need to get the speakers mounted on the wall for a proper cinema experience.

The software for the DLNA was a little awkward, but we got it working in the end. The Pi is running GMediaRenderer, a DLNA renderer for GStreamer. This had to be compiled from source and took some fiddling before it worked how we wanted it. This was worth doing though as we were then able to customise how it looked in the client app. Our logo is on it! We can already cast sound from laptops too, pulseaudio-dlna can cast sound from your linux PC to any DLNA device on the network and it works great.