Introduction to Programming Lego Robots

Step-By-Step Tutorial

1. To start software, Start | All Programs, then select Lego Mindstorms | Robotics Invention System 2.0.

2. Click on “Run”. To stop movie that plays, click space.

3. On the Login page, enter your name and click enter. Click space again to stop another movie from playing.

4. On the main menu Click on the “Program” Button. The software tells you that you should go on Missions run through their tutorials). For now, click the box labeled “click here to unlock these options”, then click “Ok” and click "Program" again.

5. When a window appears labeled “Program your Robot”, select “Pick a Robot”.

6. Choose “Roverbot” as your robot type, and click on the button labeled “Program this Robot”.

7. Finally, you should be on the programming screen. There should be a menu of commands to the left, and a menu on top.

8. Drag a forward button into the box labeled “Place Block Here”.

9. Choose File | Save. and save the file as "forward1".

10. Downloading and running your first program.

a. Place your robot in front of the infrared tower and make sure the robot is on.

b. Back on the computer screen, click “Download”. A green light should appear inside the tower. After a few seconds, the robot should make a noise that means the download is complete.

c. Set your robot on the ground.

d. Push the run button. What happens?

Tasks

1. Write a program that causes the robot to move in a rectangle.
2. Write a program that causes the robot to move forward indefinitely. You’ll need to use a Repeat Forever block.
3. Write a program that causes the robot to move in a rectangle two times. Use a Repeat For block.

Sensors

The sensors are the yellow hands in the front of the robot. You can program the robot to react to those sensors being touched (the robot hitting something).

To use the sensors, use a repeat until block-- repeat until sensor is touched.

Right click on sensor block to set the parameters (i.e., which sensor should cause a reaction).

Tasks

Write a program that makes the robot move forward until it hits something, then goes backward for 2 seconds.

Write a program that, three times, hits something and backs up for one second.