Graphical programming with the Arduino IDE

The Arduino is an excellent first embedded development kit, provides a great introduction to electronics, and has the potential to get children into programming. [David] thinks throwing C at non-programmers isn’t the best way to learn programming, so he developed ArduBlock , a graphical programming language for the Arduino.

We’ve seen a number of graphical, block-based programming languages in our time, most notably Scratch. [David] found a project called OpenBlocks that serves as the basis for Android App Inventor.

[David] forked the OpenBlocks project and started working on his new graphical programming language. ArduBlocks uses the Arduino IDE, so everything possible in C with an Arduino should be possible with ArduBlocks. There’s a lot of thought put into the design of the blocks – the first iteration was far too ‘busy,’ but [David] cleaned it up and made the projects understandable.

For an absolute beginner, we couldn’t imagine anything better. ArduBlocks would be great for children, and we can’t wait to see a proper implementation of ArduBlocks with a touch screen.

I’m most certainly a real engineer, and I found an Arduino a great way to familiarise myself with hardware coding as my hobby. While I’ve moved on to coding for other AVR uCs I still find it handy to fine up the ‘duino to create something I need quickly.

Real engineers never discount anything that can get a job done with the minimum of effort.

“real engineers”…you mean miserable pessimistic assholes that can’t stand the thought of anyone being happy about anything. If you’re an engineer and waiting for arduino to “go away”, you might as well learn to live with it, because it’s here to stay. Why should you care anyway? Or do you just love to find shit to gripe about?

I love the Arduinos and I like that people are always trying to make things easier, but I toyed with App Inventor once and it was genuinely harder for me to figure out how to put a working program together with it than a simple code tutorial. Maybe I’m just weird.

Are visual blocks really easier for new users? I remember being taught that programming was just breaking down a task into specific steps and then ‘telling’ the computer what to do. Are picture blocks a more natural way to do that?

The two main challenges of programming vs holding a conversation are that a computer needs the task broken down into much more detail than a human would. Also the syntax of the language you use must be exact.

As humans we almost exclusively tell each other what to do using words. Deaf people use hand movements and in one part of the world some people use whistles but I have never heard of anyone whose primary means of communication is picture blocks.

As one of the developer of ArduBlock, I have been asking myself the same question and I came to the same conclusion that visual block programming language can’t be better then textual base program. But being better then textual languages isn’t the goal of visual block languages.

Much like reading and writing, it’s not part of the inert nature of human being. It’s a long hard process of acquiring the ability and it took us thousands of years to spread that skills among the general population.

I started the project simply to get my daughter interested in physical computing after we did Scratch together when she was 4 1/2. I watched her struggle at learning how to read and write at the same time. Pictures books and bed time reading are used to assist her in the learning process.

This is the same reason I worked on ArduBlock. It’s not about giving her a better tool then textual languages. It’s a tool to assist her to get interested in this and eventually go to textual based language when she gets interested enough.

I wasn’t really questioning whether graphical programming is ‘better’ than text based. I see people commenting about using graphical programming for complex tasks and realize that they are missing the point. I was more questioning whether visual computing (including graphical programming) is really easier to learn than text based.

Don’t read too much into that though. I am not trying to put down your project. I think it looks pretty sharp and congratulations are in order! I’m sure it’s easier to learn than C. Also, even if someone ported some introductory language like Logo to the Arduino choices are still a good thing!

I also realize that there is more to an introduction than being easy. ArduBlock looks much more visually appealing which could be the difference between a kid getting interested enough to give it a chance or not.

I have a 1 1/2 year old daughter myself and hope to encourage her to become a maker one day. Maybe we will give ArduBlock a try!

Well, I have seen this discussion every time someone post about graphical programming. At least for me, engineer has some relation with numbers. Well, we released Minibloq this year, and we also manufacture Multiplo (an open building system for teaching tech and robotics to kids and beginners). I can tell that we are now manufacturing 10 times what we were at the beginnings of 2010. And we are still growing a lot. And a lot of schools in our country (Argentina) are replacing propietary robotics equipment with open source systems, which is possible now that Arduino compatible robots has a graphical tool. This was a barrier a year ago. These tools, like Ardublock, Modkit and Minibloq are helping, each one with a different approach (you can try them all!) the open source movement to be introduced in schools. That’s enough for me. I’m not a purist, I’m a pragmatic guy, and happy with this pragmatic view. So congratulations David for Ardublock! And congratulations Ed for Modkit too.

well i have to agree,when i was their age i was already coding in Visual basic and all that from reading BOOKS.
Now days everything have became WAYYYY to easy for those little ..ergh .
Anyway what i have to say use the standard arduino pakage

I have to say I used to be a hater, but after years of easy prototyping because of the open source nature of the arduino and its community, I have learned to love this microprocessor!

Don’t be a hater until you’ve used at least 4 other types of programming of microcontrollers. I personally love my other faster dev boards, however I find myself saving them for more complex projects (that never seem to happen, as 16Mhz seems to always be more than enough!)

I originally submitted this article. I’m surprised at the number of negative responses from all of the curmudgeons. I found the app to be quite helpful. I’ve some experience in coding but only do it casually as I have too many hobbies and interests. I value simplicity, speed and efficiency that these microcontrollers provide. Apps like this allow me to make efficient use of my time and receive immediate results.

Interesting concept. If anything it provides a great stepping stone to more advanced methods of programming, much like Basic does for C or Assembly.

Elitist engineers be damned. Did you forget the philosophy of doing more with less? Or perhaps you just feel threatened or bitter that beginners can build cool things that required much more work when you did it 25 years ago. It’s called living in an increasingly technological world, deal with it.

Graphical programming is ok for simple stuff, but it becomes unbearable for more complex tasks. It is essentially hieroglyphics versus alphabet: 30 letters of alphabet are enough to convey all ideas with clever use. You need to use and remember very large number of pictures to convey complex concepts.

If you look at the ArduBlock website, it’s pretty clear they’re not intending it as an alternative to the traditional text based C programming for complex tasks. It’s pretty clear it (and Minibloq and the others) are intended as a simpler stepping stone for children and/or adults who are unfamiliar with programming.

IMHO, that’s what sounds exciting about ArduBlock. It sounds like it takes your diagram and generates C code in the Arduino IDE. That sounds like it’d be a great way to help beginners visualize what programming constructs do while giving them familiarity with what the “normal” text representations should look like.

Yeah, damn LabView, it’s just totally useless isn’t it? I mean, all those factories they run using it, and all that data they gather and the built in graphics information displays…. just useless!!

Anybody that uses it, is just wasting their time right!! Graphical programing is just useless!!

God, what do you do for a living I wonder??

Yeah, LabView, like ANY other language, can be put together in a sad way so nobody understands it.

At least you can follow it, follow the lines if nothing else. In text based languages, you’d have a very hard time deciphering anything if you ran across some bad code.

I worked for a company, and one of the engineers had almost total control of a project. His “code” was just MONSTROUS. He would constantly make changes, and not document them, just print another 5,000 pages of code out. Who cares, HE knew what it said.

but once he got fired, we had to scrap the whole thing, because it was just totally worthless. You couldn’t possibly read it, even with the few lines of comments he included.

I wrote some stuff in LabView that worked, but not well, or “right”. But at least people could follow my code easily enough. Just following the lines.

i suspect, and I’m probably right, you know NOTHING about LabView and have never used it.

If you want bad examples of bad text based code, I can post 1,000 for every bad example of LabView you post.

Ditto, on LabView. Another hugely successful graphic language: Simulink. It’s got a somewhat different focus, but the principle is the same: Tell the computer what you want done; count on the underlying simulation engine to do it.

Complex problems, no problem. I remember, back in 2000, when Mathworks bumped the maximum number of blocks from 100,000 to 500,000. No telling what the limit is today,or even if there _IS_ a limit.

What’s that you say? A program with 500,000 blocks is unmaintainable?

Er … ever hear of modular programming? You don’t just splatter 500,000 blocks on a single model main page. You use the basic building blocks to build small black boxes with well–defined — and thoroughly tested — interfaces. Then you use those black boxes in somewhat larger black boxes, etc., etc. Just as in C/C++ programming, your main program should fit on a single screen.

Simulink is not just used for simulating dynamic systems. It’s also used as the code generator for “flight” code. Simulink used to generate C code, which could then be compiled to the target hardware and tested. That was a problem because companies had to maintain both the Simulink models and the C code.

That’s not the way it’s done anymore. AFAIK, every single large organization in the world, including NASA,DoD, FAA, and SAE have all approved going straight from Simulink models to flight code. Engineers never even SEE the C code.

I grew up using the LEGO Mindstorms programming interface for the original RCX and would love for something similar while I get to grips with the Arduino. Thankfully HaD can cater for my needs as to the electrical side fo the learning curve.

I don’t often post my view but one view of graphical programming prodded me. Yes, graphical programming only supports the simple solutions and arduino user training. But isn’t that how many languages started? I feel that in 1-2 years, graphical programming will develop into a powerful option and what’s wrong with that? ‘Anyone’ reminds be of so many Luddite movements.
Oh well, back to obscurity, my rant is done.

Back in the 80’s (as I recall), Borland had a graphical programming language (sorry, I forget the name). At first glance, I thought it was great. But it fell out of favor because you could only do the simplest things within the graphic paradigm. As soon as you needed to do something that wasn’t part of the language, you discovered that you were down-n-dirty in the worst kind of custom code.

Graphical languages do have certain appealing features, not the least of which is, you can’t screw up compound structures like if-then-else or while or for-loops. Drag in a while loop, and the predicate and the loop end come with it. No more dangling else’s.

The argument that it’s just like flowcharts, which are obsolete, is specious. Flow charts fell out of favor because programmers failed to keep the chart in sync with the code. If the computer is managing them both, that can’t happen.