Tuesday, May 20, 2008

Lego hacking tomfoolery

First-generation RCX programmable brick.Image via WikipediaI love the way that there are so many other people out in the world who love to dig in to a beautiful piece of tech, in this case the LEGO Mindstorms RCX kit, and do all sorts of weird and wonderful things with it.

I got a set a couple of years ago from my girlfriend for Christmas, and at the time, because the bundled software wasn't the may west, I wasn't able to do a lot with it. Since then I've branched out a good bit into the wilds of open source code and custom hackery and discovered LeJOS (lejos.sourceforge.net). At it's core its a tiny JVM, based on (drum roll please) TinyVM . There are versions available for both the RCX, the older model that I've got, plus the NXT, the oh so wonderful beautiful shiny, fandiddlyastic new one that comes with aaaaaaalll sorts of goodies. There also other packages available in other languages, such as C#

What this gives you is the ability to write your own Java code to make the funny wee robots do damn near anything. The new version gives full access to the bluetooth commands (I think..) , so if you went with this OS, you'd be able to do fancy stuff like construct a motion detecting robot that looks like Johnny5 (God bless this woman, she is a LEGEND), that fires off lego rounds and chases people around the room. (I think I'm drooling on my keyboard...)

There's also a handy wee Eclipse plugin for both the RCX and the NXT that will do all of the interfacing between the machine and the brick for you, meaning that all the programmer has to do is write the damn code.

I've gotten all of the underlying basics up and running on my home system, or I had before it presented me with a delightful BSOD. Luckily I run an Ubuntu dual boot, and all of the shiny bits run under that too so I can just shift over. Whenever I actually get around to creating something useful is a whole other story. See related articles for other fun.



Note: Google just handed me this lovely little snippet of Lego-like goodness. Oh the fun we could have.....

No comments: