Tag Archives: Raspberry Pi

Member project: John’s Tetris Table

dsc_5714

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.

dsc_5712dsc_5709

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.

dsc_5711

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.

dsc_5708dsc_5715

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.

Enjoy.

dsc_5707

A multimedia system fit for a hackspace

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.

Projector showing demo image

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.

Cambridge audio amplifier and speakers

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.

Raspberry Pi in case, connected to amp

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.

HDMI converter boxVideo format 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.

dsc_5150