Exactly What She Said

Exactly What She Said

It was already sizable, but then it just kept getting bigger and bigger

The long awaited update to druid4arduino is finally on its way–it’s currently awaiting publishing in the app store–but it took a whole lot longer than expected, in part because of the enormous endeavour it morphed into along the way.

It began with a rewrite of the druid4arduino GUI.  While I was at it, SerialUI could use some better management of user input, right?  That turned into something relatively major for reasons I’ll get into another time.

Still, after dealing with a few mystery bugs on my dev system, the new druid was ready to go.  This is the result:

However, by this point SerialUI had become a bit of a handful… just the notion of having to document all that functionality was giving me pause.

And that’s when I had a bright idea(tm): why not have some kind of generator, maybe an online web page or something, that would take a developers preferences and massage them into an automatically generated SerialUI setup?  Shouldn’t be too complex…

Ah, the creator’s optimism.  That notion finally turned into this:

It’s more fully described on the Device Druid: How It Works page, but the gist of it is that I wound up creating:

  • another app to do the design, Druid Builder;
  • a server-side system, to handle builder requests; and
  • a pretty cool system of worker threads, running on distinct hosts and all working together through message queues, to generate the projects and test the code.

The app has a drag & drop system for designing interfaces, allowing you to add commands/input requests/sub-menus.  It also lets you customize the code inline, so it has a basic code editor for which I couldn’t help myself and ended up adding programmer-friendly stuff, like indentation management, auto-brackets, and even dynamic code completion.

The wizards on the server do their best to be smart and generate decent code.  They even do a trial run and test your creations, and can be pretty handy for detecting typos and other errors.

Everything gets packaged and delivered as a zip file of the project, which can be compiled for whatever platform you’re using through the Arduino IDE or otherwise.

A quick look at the results:

I’m pretty happy with the system and, in a perfect example of eating your own dog food, I’ve come to rely on Druid Builder to whip-up programs as part of my regular work day.  I think that’s a good sign.

So the app should be available by the end of today with more versions and updates coming in the near future.

Do get in touch, here or through the device druid site, with any stories of success (or woe) using all this new stuff.