Frotzuino: Switching on the lights in a text adventure
When I visited NYCResistor in July, i brought gummy bears and Kinder eggs with me which were apparently very much appreciated. Zach Hoeken handed me a little anti-static bag and mumbled something about “electronics in exchange for candy”. It was a prototype for the Sanguino board which he had developed. Last week I finally had time to play with it.
The Sanguino is basically a better, faster, more-of-everything version of the open source electronics platform Arduino. Maybe it would be best to let the people at NYCResistor explain it themselves:
Sanguino: Arduino’s Big Brother from Zach ‘Iowa’ Hoeken on Vimeo.
On Thursday I assembled the board and soldered a TTL to USB interface to it. It should be noted that I would have been lost more than once without the incredible help of Alex “fd0” Neumann at C4, since this particular beta version board had some problems that have since been resolved (i.e. there was nothing preloaded on the Atmel and the software available online needed a patch). The weekend after that was FrOSCon, a wonderful Free/Open Software conference in Sankt Augustin near Bonn, which some members of Netzladen organized. I spent some of my time there writing an embarrassingly simple “Hello World” program for the Sanguino. On Sunday at FrOScon, I did a 5 minute presentation on it, since some people asked me if i was building a bomb and I believe that the Arduino platform should be better known among Open Source people.
The “Hello World” of electronics is a blinking LED. The Arduino sketch I wrote isn’t much more, really, and it’s overkill to use a platform like the Sanguino for it. The setup consists of an LED on the breadboard with a resistor as a voltage divider. There’s also a push button. When you push the button, the LED is turned on. When you push it again, it’s turned off. Pretty primitive, but I wanted to use it for a useful retro-gaming interface.
I happen to like text adventures, especially those from Infocom that used to be popular in the 1980s. These are worlds created in text form, where you wandered around, solving riddles and quests using short English sentences like “GET LAMP” or “GO NORTH”. Some people prefer the term “Interactive Fiction”.
When playing a text adventure, you may be ending up in a room without a light source. Pitch dark, without a way out. I wanted to solve this problem with the Sanguino. Pushing the button should turn on the light in the text adventure.
I added a line to the Arduino sketch to communicate the current state of the LED over the serial line to the computer. Next, I wrote a tiny wrapper around Frotz to read input from the serial interface. Frotz is both a popular interpreter for Interactive Fiction and a magic spell in some text adventures to make light, so it seemed fitting.
All in all it took me about 2 hours to have everything set up so I could have a device to switch on the lights in a textadventure. Have a look:
Frotzuino from Jens Ohlig on Vimeo.
This is my weblog. I write about projects and stuff I build in my spare time, be it code or tinkering with physical objects. You can find out more about me on my