Figure 10
all the way to the left for one rotation (Figure 8).
• For the last step, we need to add a loop which will
cause the program to repeat itself indefinitely, rather
than stopping once it performs each action once.
Drag a loop into the programming area but off to the
side of the rest of the blocks.
• Click and drag across the four programming blocks
aside from the loop to select them all at once
(Figure 9).
Eddie will move forward until he hits a wall that trips
his touch sensor, causing him to move backwards, turn
away from the obstacle, and then will continue onward.
You’ve just built and programmed a robot that is capable of
interacting with its environment physically via touch sensor,
and reacting to it by avoiding obstacles!
Wrapping Up
Next time, we’ll be looking at two more sensors, and
getting into some more complex programming to really get
a feel for just how powerful the NXT is.
If you’re enjoying The NXT Big Thing, and want to see
more articles featuring the MINDSTORMS NXT, please take a
second to let SERVO know at editor@servomagazine.com.
Thanks for reading — see you next time! SV
46 SERVO 09.2010