Present Perfect


Picture Gallery
Present Perfect

Scrolling LED Marquee part two

Filed under: Hacking,Python,Twisted — Thomas @ 10:39 am

10:39 am

Following up on a previous post, I’ve been writing some code to do useful things with my scrolling LED marquee.

It gave me a chance to try my hand at implementing another protocol in Twisted, and it was a pleasurable experience. I still firmly believe that Twisted’s code and design combines so much knowledge about these things that I will now never have to have in my life because I can rely on it being designed properly for the task.

I got it working quite quickly, reusing some activatestate code for a feedparser, and now I have my marquee following a bunch of feeds like StackOverflow‘s python tags, SlashDot and VRT news.

Here is a link to the video of the marquee showing (old) news from slashdot (using Cortado to watch it), or a link to a playlist to open in a player, or a link to the Ogg file directly.

I had the original version working over the serial port, but these days a serial port is a hassle. The marquee also included a USB plug which has a built-in serial port, and it didn’t work out of the box with that. After some fiddling I realized that for some reason, over USB the replies of the device (which sends ‘ACK’ to acknowledge) come in separate packets (sometimes two, sometimes three, one per letter). It was simple to fix in the protocol implementation, and that’s where Twisted’s levels of abstraction really shine – a simple fix in one location at exactly the right logical level.

Last night I added a quick and dirty hack to have it also display what song Elisa is playing. I should start worrying about managing the marquee’s different pages now so that it can easily mix different information sources.

Oh yeah, the code. Not sure you’d find anything interesting there if you don’t actually have a scrolling marquee, but here it is. If you have a similar device, I’d be happy to help you out get this set up and add support for it.

And if any Twisted people want to comment and help me improve my probably poorly implemented protocol, comments appreciated!

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment