Fun Projects for your LEGO MINDSTORMS NXT!

Home     Projects     Help     Contacts

Multi-Bot Programs
Building Instructions

These pages describe the over 70 programs for the Multi-Bot robot and its variations that are included on the CD "LEGO MINDSTORMS NXT 2.0 by Example".  The programs are organized into sections that are designed to teach different programming concepts (motor control, sensor usage, etc). 

Owners of the CD have instant access to all of the programs in ready-to-run form.  Web users without the CD might challenge themselves to try to write some of the programs given the description, or use the descriptions and observations to inspire programs and experiments of their own.

Downloadable programs are available only on the


Selected Fun Programs

E2-ExploreWalls (with Treads and Ultrasonic Sensor)
Multi-Bot will wander around the room trying to avoid walls.

E6-MagicPush4 (with Ultrasonic Sensor rear mounted)
Mount the Ultrasonic Sensor to Multi-Bot's rear bumper pointing backwards, and then your hand will appear to push Multi-Bot along with an invisible repulsive force.

E9-FindShoot (with Treads, Ultrasonic Sensor and Ball Shooter Arm)
Place an empty soda can or water bottle anywhere near Multi-Bot in any direction, in an open area of the floor, and Multi-Bot will find the container and shoot it down by firing a ball at it.

F9-CountPress (with Touch Sensors as wired remote)
A contest on the NXT to see how many times you can press a touch sensor in one second.  How fast can you press?

F13-DriveShoot (with Touch Sensors remote and Ball Shooter Arm)
A sophisticated two touch sensor remote control that let you control Multi-Bot with the following actions:
     1. Press and hold the left button to turn left
     2. Press and hold the right button to turn right
     3. Press and hold both button to go forward
     4. Tap the left button to back up, tap again to stop
     5. Tap the right button to shoot a ball
     6. Release both buttons to stop

F14-Golfer (with Touch Sensors remote and Golfing Arm)
A remote controlled golfing robot, with similar driving control as F13-DriveShoot above, except that tapping the right button will swing the golfing arm instead.  Start with the arm down and a ball on the carpet.  How many hits will it take you to get the ball into the hole or other target that you make?

F16-Bumper2 (with Treads and Touch Sensors bumper)
Multi-Bot will wander around the room bumping into things with its bumper, try to turn away from what it hit, and keep going.

G2-SumoColor (with Treads, Line Sensor, and Sumo Pusher)
Multi-Bot will stay inside an area marked on the floor with a black tape border, and try to push other objects out of the area.

G3-ColorDrive (with Treads and Line Sensor)
Multi-Bot will drive along a path or course marked with blue tape or paper on the right border, green on the left, and red at the finish line.

G7-BallTrap2 (with Treads and Ball Trap Sensor)
Multi-Bot will drive until it traps a blue, green, or red ball, then it will stop and speak the color of the ball that it found.

G9-BallHunt (with Treads, Ball Trap Sensor, and Golfing Arm)
Start with a few blue and green balls on the carpet near Multi-Bot at different angles.  Multi-Bot will try to find the green balls and hit them with the golfing arm, but leave the blue balls alone.

G14-ProFollow (with Treads and Line Sensor)
Multi-Bot will follow a line marked with black electrical tape on a light-colored floor, following any straight and curved parts of the line.  The program will start with a "calibration" sequence that you use to easily measure the sensor values that robot sees over darkest part (center of line) and lightest part (open floor) to get the best performance.

J2-ReactionTest (with Touch Sensors as wired remote)
A game to test your reaction time.  After getting the "GO!" signal on the screen, how fast can you press touch sensor 1?

Index of Program Sections

(A-B) Driving Straight
     Driving Straight - Basic
     Driving Straight - Advanced
     Using My Blocks to Drive Straight

(C-D) Turning
     Basic Turning
     Advanced Turning
     Using My Blocks to Turn

(E) Using the Ultrasonic Sensor
     Ultrasonic Distance Measurement
     Advanced Object Detection

(F) Using the Touch Sensors
     Single Touch Sensor
     Double Touch Sensor Remote Control
     Double Touch Sensor Bumper

(G) Using the Color Sensor
     Color Sensing
     Line Following in Light Sensor Mode

(H) Using the Light Sensor
     Line Sensing
     Line Following with the Light Sensor

(J) Using the Internal and Motor Sensors
     Using the NXT Buttons
     Using a Timer
     Using the Rotation Sensors



My Blocks Included

Some of the Multi-Bot programs use My Blocks to simplify them or to provide useful custom blocks that you can re-use in your own programs.  Below is a list of the My Blocks included with the Multi-Bot programs, with an example program using them.  Loading the example program will load and install the My Block into your Custom Palette where you can re-use it in your own programs.  To learn more about creating and using My Blocks, see the My Block Tutorial.

My Block Description Example Program
Forward Drive forward a given distance in cm at a given power B9-Move_cm
Backward Drive backward a given distance in cm at a given power B9-Move_cm
ForwardAccel Smoothly increase speed and stop at a given distance in cm B10-Accelerate
PivotLeft A consistent pivot turn of given degrees and power D6-PivotBlocks
PivotRight A consistent pivot turn of given degrees and power D6-PivotBlocks
LeftPivotAngle A pivot turn specified by robot heading angle D7-PivotAngleBlocks
RightPivotAngle A pivot turn specified by robot heading angle D7-PivotAngleBlocks
FindObject Find a nearby object with ultrasonic and point robot at it. E7-FindObject
DisplayNum Display a number on the screen with a label in front G11-DispLight
CalibrateLight Calibrate the color sensor in light sensor mode G12-LineFollow2 *
CheckLightCal Calibrate the color sensor if needed or if the user wants to G12-LineFollow2
LightCalibrated Output calibrated brightness in percent from color sensor G12-LineFollow2
B Power Adjust power to motor B, negative power reverses direction G14-ProFollow
C Power Adjust power to motor C, negative power reverses direction G14-ProFollow
AskNumber Allow user to enter a number on screen using NXT Buttons J1-AskNumbers
LimitNumber Modify a number if necessary to be within a specified range J1-AskNumbers *
DisplayMotors Continuously display rotation sensor angles and allow reset J3-DispMotors

* = The My Block is contained within another My Block inside the sample program (and loads with it)


Home     Projects     Help     Contacts


Copyright 2007-2011 by Dave Parker.  All rights reserved. 
All project designs, images, and programs are protected by copyright.  Please see the usage policy.