Enchanting Programs
Enchanting lets you program your Lego Mindstorms robots in a language and environment based on Scratch.
Enchanting lets you program your Lego Mindstorms robots in a language and environment based on Scratch.
Enchanting is a free, open source programming language that allows you to program Lego Mindstorms NXT robots in a Scratch-like language. Many kids are familiar with Scratch, and we found we were able to start programming robots almost right away.
Enchanting [1] can be run in Windows, Mac OS X, or Linux. The Enchanting application can be downloaded from Canonical's Launchpad [2].The first time that you run Enchanting, it will need to reload the NXT firmware with LeJOS (a Java-based Lego NXT firmware). You'll see a warning message about possible problems during this process, although we loaded and unloaded the firmware many times without any issues.
We found that Enchanting had all the functionality that the Lego software had. The only exception was Bluetooth support for brick-to-brick communications. Some of the things we liked about Enchanting include:
We built a simple ball-throwing robot that was activated with a push button. Although there are many ways you could build the robot [3], we chose a fast-moving straight arm that used one motor (Figure 1). With the fast motion of the throwing arm, we needed a large Lego mounting sheet for support.
The first step in writing the application was to define which ports the motor and touch sensor were plugged into. To define the motors, click the Motors button, then select Configure Motors and drag the NXT motor
block to your port (Figure 2). To configure the touch sensor, click the Sensing button, then select Configure Sensors, and drag the Touch Sensor
block to your port (Figure 3).
The entire program comprised only about 12 blocks (Figure 4). All programs need to start with the when
clicked
block. The forever
block was used to repeat the ball throwing many times. For our code, we had the arm rotate
up fast (-90
degrees) and come down slowly (90
degrees). We added sounds and a cool background to make it more fun.
Some future project ideas could include:
Pages: 4
Price $15.99
(incl. VAT)