Building and Programming M.Pathfinder
In this lesson you will build a modified Pathfinder called M.Pathfinder. Then you’ll figure out how to program it to do things by itself.
|
What to do:
Build M. Pathfinder: Follow the directions on the M. Pathfinder Building Instructions handout.
Run M.Pathfinder:
Turn on the RCX by pressing the red on-off button.
Press the gray Program button repeatedly, until you reach Program #1. (The number 1 will show on the right side of the display window.)
Place the RCX on the floor where it has enough room to run, let it run, then catch it and turn it off.
How to make M.Pathfinder go and stop by itself
|
Here’s a shortcut—three blocks in one!
Important note: In both programs the motors are turned off after 3 seconds.
|
Remember: The only commands that turn motors on or off are on, on for, and off.
You know enough now to start writing programs on your own, telling M. Pathfinder what to do. Here are some ideas for what M. Pathfinder can be programmed to do. It can be programmed to:
|
|
You may choose to write a program for any of these ideas or come up with your own idea(s).
Be sure to solve the following problem before moving on to the next activity.
Write a program that tells M.Pathfinder to go toward the wall, hit the wall and go backwards. Here’s what to do:
1. Using masking tape, mark a line on the floor 2 or 3 feet away from a wall.
2. Write a program, telling M.Pathfinder to move forward towards the wall and go backwards after it hits the wall.
3. Save your program.
4. Download the program.
5. Place M. Pathfinder on the line facing the wall. Run it.
When you run the program, pay attention to what it’s doing:
· Did it hit the wall or did it go backwards too soon?
· Did it go backwards as soon as it hit the wall, or did it try to run into the wall?
Note: Most people solving this problem for the first time have to go back to the computer and change their program. It rarely works perfectly on the first trial.
Now, move your line farther away from the wall. What do you think is going to happen when you run M.Pathfinder?
Try it.
What will you have to do to fix it?
Thinking about it
Do you think that M. Pathfinder can tell when it hit the wall? Why or why not?