October 21, 2013
I do a lot of work with local schools, talking about engineering, ham radio, rocketry, robotics, and — of course — embedded systems.
I do a lot of work with local schools, talking about engineering, ham radio, rocketry, robotics, and — of course — embedded systems. Depending on the grade level, some of the kids are already pretty experienced programmers (especially, for some reason, with Java). But the younger kids often don’t have any programming expertise.
I’m no expert in how to teach children, so I’m not sure what the right way is for kids to acquire programming. However, I know what has been done. A lot of people my age first learned BASIC (which wasn’t my first exposure to programming, but I did my share of it). BASIC introduces a lot of bad habits, but it is also both a high-level abstraction (compared to, say, assembly language) and a low-level abstraction (compared to C++ or Java). I’ve used variations of BASIC with some success in robotics classes. You can learn it pretty quickly, and if you provide some canned subroutines, the students can get some quick results.
Some of the younger kids (and some of the older ones, too) have been exposed to graphical block-like programming languages. Usually, they’ve run into the Lego Mindstorms NXT-G language. Some have even used a similar system from MIT called Scratch. Scratch was the foundation for the Android App Inventor (something I talked about some time ago) and, to come full circle, you can use Scratch to program Mindstorms.
Of course, the current darling of introductory embedded systems is the Arduino, and these are showing up more in school programs and projects. Wiring sketches (programs, really; I hate calling them sketches) are really just C++ programs with a few stock functions, a class library, and a very odd build system. Of course, it isn’t terribly difficult to master the Arduino and the class library is convenient.
Although I know it will irritate the faithful, I’m always mindful that the Arduino is really just an Atmel CPU and a bootloader. All the other stuff is just PC software. With that in mind, there are a few options for using potentially kid-friendly software with the Arduino.
Dr. Dobb’s has a long history with Tiny Basic, and there is a Tiny Basic for the Arduino. For a tiny language, there are quite a few features available, and while it doesn’t have the features of a Basic Stamp, it is a credible system for getting kids to write code on the Arduino.
For the graphical crowd, there’s S4A. This is Scratch for Arduino. It isn’t exactly a programming language. It is actually a bit of code that runs on the Arduino and communicates with a Scratch program using a protocol that updates inputs and outputs every 75 milliseconds. The program doesn’t actually run on the Arduino, but uses the Arduino as a peripheral device.
I like working with young people on engineering projects. It is a way for me to pay forward the people who helped me. Besides, I might have to hire some of these kids one day! Even if a young person never actually becomes a practicing programmer, it is valuable to get the logic and problem-solving discipline that a programming project provides.
Speaking of teaching programming, you might be interested in Small Basic from Microsoft. There is also a site dedicated to teaching programming to kids, and, as mentioned earlier, Scratch. None of these are aimed at embedded programming directly, but they are still useful for building understanding that could be a foundation for more embedded pursuits.