The Null Device

mbed = agile web-based hardware hacking

Seen at Maker Faire: Two guys from ARM (the people who designed the CPU in your mobile phone and probably a dozen other devices you own) have designed an amazingly elegant new microcontroller prototyping board, for making electronic gadgets even more easily than with the Arduino. Called mbed, it consists of a board with a USB port and 40 pins. The pins do the usual things (analogue/digital I/O, USB, Ethernet, &c.), but that's not the impressive thing about it; the impressive part is the design of the whole system, which brings web-style agile development to microcontroller-based gadgets.

When you get an mbed, you plug it into your computer (which may be a Windows PC, a Mac, a Linux box or anything else which can mount USB drives); it then appears as a USB disk, containing one file: a web link. You go to the web link, which directs you to mbed's web site, where you log in or create an account; from then on, you have an integrated development environment in your browser, with source navigation, syntax highlighting and a compiler. Your code is hosted online on mbed's servers (the system uses the Subversion version control system as a store). Create a new project, and you get a "Hello World" program (written in C++) which, by default, flashes one of the mbed board's built-in LEDs. Hit the Compile button, and your browser soon prompts you to download a .bin file of the compiled program. Save it to the mbed card's drive, hit the reset button on it, and your program runs.

That's not all, though; the mbed card can work with a plethora of hardware modules, from Nokia-style LCD displays to GPS units, Bluetooth modems and more. Which is where the next bit of elegance comes in. There exists an ecosystem of modular classes for driving these various devices. To attach a supported device, all you have to do is add the class for it to your project (by pasting the URL of its Subversion repository into a dialog box; the IDE does the rest for you), instantiate it as an object and call its methods. For example, here is code for drawing on a Nokia-style LCD display:

MobileLCD lcd(p5,p6,p7,p8,p9);  // the I/O pins
lcd.background(0xffff99);
lcd.foreground(0x000000);
lcd.locate(2,2);
lcd.printf("Hello world\n");
lcd.fill(0,64,128,128, 0xffffff);
This goes some way towards making building gadgets as easy as building web applications with a framework like Django or Ruby On Rails.

mbed is somewhat more expensive than the Arduino (the price quoted was about £45 for the mbed board itself, whereas Arduino-compatible boards go for £13 or so). However, the elegance of the design, its ease of use and sheer niftiness could make it worth the price.

There are 3 comments on "mbed = agile web-based hardware hacking":

Posted by: Jim Mon Mar 15 12:01:38 2010

"Your code is hosted online on mbed's servers"

And that's where they lost me.

Posted by: acb http://dev.null.org/acb/ Mon Mar 15 22:03:03 2010

I take it you're not a fan of Google App Engine either then?

Posted by: acb http://dev.null.org/acb/ Tue Mar 16 11:50:39 2010

Anyway, given that the mbed board's boot loader just finds the most recent .bin file on its attached FAT filesystem and loads and executes that, and that you can presumably download the support libraries, I imagine that it won't be too hard to compile your own mbed-compatible code entirely offline with GCC.

Want to say something? Do so here.

Post pseudonymously

Display name:
URL:(optional)
To prove that you are not a bot, please enter the text in the image into the field below it.

Your Comment:

Please keep comments on topic and to the point. Inappropriate comments may be deleted.

Note that markup is stripped from comments; URLs will be automatically converted into links.