User's Manual

First the program must make sure that the container is empty—this is just a precaution against readings that may still exist
in the RCX from previous activities. The Add to Container adds a value of one to the Container Fork. The Container Fork is
set to count the light being turned on fi ve times. So long as the value is below fi ve, the lower string is chosen.
The lower string turns on the lamp, waits for one second, turns off the lamp and waits for one second again. The red Jump
Arrow, returns the program to the red land arrow.
This is repeated until the container has added a value of one, fi ve times—after which it adds a fi nal value that tells the Con-
tainer Fork to choose the upper string, a sound is played and the program ends.
Introducing a different way to use the container commands, combined with
light sensor
1. Use your two motored vehicle. Make sure the light sensor is connected to Port 1. On a long strip of paper draw 10 parallel
thick, dark lines with an identical distance of 5 to 10 cm.
2. Delete the program on the screen and copy the program string below. For this challenge you will need the Container
Fork command to tell the robot to react to the value of the container.
3. Download and Run the program illustrated here.
First make sure that the container is empty. The motor is turned on and as soon as the light sensor reads a lower light value
a value of one is added to the Container Fork. When the sensor reads a higher light value the jump arrow returns the pro-
gram to the land arrow. This is repeated fi ve times, after which the container adds a fi nal value to the Container Fork, which
tells it to run the upper string and complete the program.
21