Before students build Roverbot:
students of the problem they solved last: having M. Pathfinder move
towards a wall, hit it, and go backwards. Ask students whether or not
they think M. Pathfinder had a way of telling if it hit something.
Explain that it really didnít matter that there was a wall at the end
of its trip forward; it was basically programmed to move forward for a
certain amount of time.
Beyond the Basics
Show the class the touch sensor. Explain that in
order to tell when itís pressed, a robot must have a way to get that
information. A touch sensor, with its pushbutton, can send a signal to
the RCX each time there is a change in its stateóif itís pressed after
it has been released; if itís released after being pressed; or if itís
pressed and immediately released (clicked).
Connect the touch sensor to a long connector wire and
attach it to an M. Pathfinder. Tell the students that you have
connected a touch sensor to M. Pathfinder and that you want it to stop
when you press the touch sensor, which would be similar to the touch
sensor being pressed against another object such as the wall. Run it
on Program 1. Press the touch sensor. (It wonít stop.) Ask the
students why they think it wonít stop. Point out that the touch sensor
is in good working order, as shown on the display window when you view
input from the touch sensor. When itís pressed, the display reads 1;
when released, it reads 0.
It is important that students understand that it is not
enough to add a touch sensor. The program has to have a block that
reads information from the touch sensor and then makes a decision
about what to do based on this information (e.g., If itís pressed,
turn motors off).
Tell students that it is better to work with a sturdier
vehicle when attaching sensors. (It is easier to connect sensor
attachments to a sturdy construction.) Explain that theyíll be
building Roverbot, adding touch sensors, and programming it to accept
Return to Top