Neil Turner's Blog

Blogging about technology and randomness since 2002

Java on a Lego brick

The Java talk yesterday with Simon Ritter was quite interesting. He did a presentation on his laptop – it was booted to Windows 2000 and not Solaris, but he did show the presentation in Sun StarOffice 7 (which is based on The first part of the presentation was about 7 key new features in JDK 1.5. They don’t add much new functionality, instead reducing the complexity of code which is already doable. Some of the changes do, however, enable more compile-time checks, which mean that it is less likely for your program to hit a runtime error and crash. I believe most of this on the J2SE JDK bit of The Sun Java Website anyway, so you can have a look at that.
The second part demonstrated perhaps the biggest new feature, which is supporting speech – both recognition and output. It also demonstrated the open source leJOS project, which is a 14KB (!) Java Runtime Environment for the RCX module that comes with Lego Mindstorms kits. To give it some context, when installed, the JRE for Windows is over 40MB – 2500 times larger. Admittedly, things like AWT and Swing haven’t been ported, but then you don’t need a Windowing system for a computer with a 5 character LCD display.
The RCX was hooked up to the laptop, and Ritter was able to use simple voice commands to instruct the RCX to do something. It had a robot arm, a series of motors and a webcam, which allowed it to pick up a card from a deck of cards, look at it, recognise what card it was, tell the laptop to announce this through synthesised speech, and then deal it. In effect, it worked as a Blackjack dealer. And this was all done using Java.
What is more amazing is the spec of the RCX. It uses an 8-bit 16Mhz processor – typical PCs now have 32-bit 2.6GHz processors now with 64-bit ones on the way. And it only has 32KB of RAM, compared to the typical 512MB you get nowadays – most chip-based credit cards have more memory than that now. But yet, you could run Java on it. Someone had even written a web server application for it that could serve up web pages should the device have a network connection. It was slow, but it worked. All from this one glorified yellow brick. Amazing.

Comments are closed.