Additional Programming Highlights

 

The End Program block is one of the Advanced blocks in the Small Blocks bin. Placed at the end of a stack, it stops all stacks from running after its stack is executed. Note that as soon as the End Program block is executed the entire program stops, as indicated by the stopped person icon on the RCX display window. Executing an End Program block is equivalent to pressing the Run button on the RCX while a program is running.

 

Here is an example where End Program can be useful if you wanted a two-motor vehicle to turn in place, move forward for 2 seconds when the sensor is pressed, and then stop.

The LEGO Group

Motor A turns on, making Roverbot turn. When the sensor is pressed, motor C turns on (joining motor A), making Roverbot move forward for 2 seconds. Then Smart Tasking returns control to the Main stack, making Roverbot turn again.

 

 

 

The LEGO Group

Adding the End Program block to the Sensor Watcher stack stops the entire program from running. After executing the Sensor Watcher stack, the program does not return to the Main stack.

 

 

 

Tech Guide

 

Close Window