Visual Programming for Arduino

ModKit have produced a visual programming environment for Arduino devices, based heavily upon the Scratch project at MIT. The ModKit Micro IDE uses the Scratch drag and drop interface for assembling simple programs which can be directly uploaded to the Arduino device, simplifying the process of writing Arduino sketches. I tried creating the basic ‘blink’ sketch using ModKit and it took less than a minute (about 30 seconds) to figure out. It uploaded without problem and worked just fine. Here is the blink sketch in ModKit:

ModKit interface showing the basic 'blink' sketch

ModKit interface showing the basic ‘blink’ sketch

Unlike the standard Arduino IDE, the program is not logically separated into setup and loop, but is all in one location. This was a bit puzzling at first, but doesn’t make a difference to the functioning of the code. The first block in the window shown above is the set up for the pinMode, that instructs the Arduino device to make pin 13 an output (rather than an input). The larger block underneath the pinMode is the loop structure, called ‘forever’, and takes the place of the loop function in Arduino. Inside the forever block are the two instructions that switch the LED on and off, and two delays. At the top of the window there is a ‘play’ button which compiles and uploads the program to the Arduino. It’s that easy.

There is a facility to observe the generated code, although this (at present) does not translate into C, but something in between. For instance, the forever block represents while(true) {}, so (like the rest of the Scratch/ModKit language) is basically a syntactic sugaring to remove the complexities of C programming.

I am looking forward to trying this out with some groups of students and some of my colleagues (Kate!) to see how well it works in the wild. For simple programs it seems to be a great way to get to grips with writing sketches for the Arduino, bringing programming to a wider audience.

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s