There are two different approaches to graphically programming an Arduino. The first is to run a sketch on the Arduino which talks to the Scratch program, passing commands and data over the serial port. The sketch is called Firmata, and requires the Arduino be attached to a computer running a server program to link Firmata with Scratch. Both Scratch for Arduino (S4A) and the newer Scratch to Arduino (S2A) use this approach. S2A seems a bit harder to set up initially, but works with the newer Scratch 2 Offline Editor.
|
|
The other approach is to translate the block structure into Arduino C-code for upload using the IDE. This might be a better option for older kids who are ready to make the transition from blocks because they can see the direct C-code equivalent. Both Blockly Arduino and ArduBlock projects take this approach, with ArduBlock actually integrating into the Arduino IDE making the transition from blocks to C-code at the press of a button. Blockly Arduino has the advantage of being web-based, so no installation is required, and the base project, Blockly, has some fun, non-Arduino, online programming tutorials.
|
|
I showed ArduBlock to one of the younger Teen Makers at the library program and he quickly programmed an LED to turn on or off at the push of a button. That may sound trivial on paper, but in practice, it is not. He had used Scratch before, and integrated some sophisticate techniques such as using flags to track state and a while loop to debounce the button.
Here is the equivalent C-code:
All of these tools make programming the Arduino a bit easier for younger programmers. They each have their strengths, but if you had to pick one, I'd go with ArduBlock because it is open source and integrates with the Arduino IDE. This makes it both easy to set up, and easy to use.












