RPi Video with Pygame

Adafruit has a new tutorial on creating video with an RPi and pygame. The goal is to create custom user interfaces on low cost hardware, powered by the easy to use pygame library. The tutorial walks through getting your RPi set up to run pygame, creating a basic pygame script that controls the framebuffer, and drawing an oscilloscope display on the screen.

This tutorial uses Adafruit’s WebIDE as a development environment. This is an excellent solution for working on video display, since you can develop the code on a networked computer and view the shell while running your graphical application. This is very useful for debugging, since you can just print information to your WebIDE console.

There’s a lot of potential for this setup. It would be ideal for creating any kiosk application. Maybe an announcement display, interactive kiosk, or even a programmable logic controller type user interface? What else could you build with a RPi attached to a LCD touchscreen?

Check out a video of Adafruit’s display in action after the break.

15 thoughts on “RPi Video with Pygame

    1. It’s a NTSC analog screen you can easily buy in every “car pc” shop. PAL would give a slightly better vertical resolution, but nothing close to a real monitor. Unfortunately HDMI small ones are insanely expensive and the Pi doesn’t have a VGA output.

      1. The AV input is NTSC or PAL. This is AT MAX 720×512 or thereabouts. i.e. anything above 640 horizontal is more or less a waste-of-bits. (the 640720 is a bit vague: It’s an analog signal, so what’s a pixel?)

        You NEED to use the HDMI output to get anything at better than effectively 640×480 resolution.

        Now, the VGA converters can be bought on ebay or at chinese shops for about $15 and work great. However, I can’t find any cheap VGA screens either. For about $100 I can easily find a nice 7″ screen to add to the RPI. But why add a $100 screen to a $35 computer? For about $100 I can get a 22″ screen! That’s about 9x as large as the 7″ screen, so shouldn’t I be able to find a $15 7″ screen?

      2. Yep, exactly what I was getting at. A cheap VGA screen would be ideal if they existed. I suppose a cheap LVDS screen would be super simple to recycle from somewhere (i.e. old laptop/netbook/handheld).

        There are a few half decent low reso screens for $30-40 out there that will do the job. I do honestly feel for anything other than a terminal 640×480 should be a bare minimum (as the original poster mentioned he uses it to play quake… which I do recall playing at 640×480).

      3. Yeah, it is awful (for playing quake at least) but it works for my purposes. It all just depends on what you expect out of it. My Pi will be running as a homemade portable (mostly just using command line for c++ programming and the occasional jaunt into the GUI for internet use). It runs an 12V reliably but down to 7V with clear colours (cuts out at around 6V) and only about 250mA peak current draw at 12V. Because of this it suits my purposes.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s