tasks and subs

Icons & HintsExamples
Hints: Use this icon to start a new task. The tasks run simultaneously. This piece of code turns on motor A. After 2 seconds it flips direction, and after 4 seconds from the beginning (2 seconds from flip) it turns off motor A.
Hints: Use this to restart tasks after they have been completed or stopped. The Task Number modifier is only necessary if you only wish to restart a certain task and not all tasks. This piece of code turns on motor A and lamp B. If 6 seconds pass and the touch sensor has not been pressed, the RCX will play a noise and turn off lamp B. Then both tasks will be restarted from the task split.. If the touch sensor is pressed within 6 seconds, both tasks will be stopped and the program ends.
Hints: Use this in direct mode ONLY. Use this icon to clear RCX of any tasks it previously had. The Task Number modifier is only necessary if you want to delete only a certain task and not all tasks.. This piece of code deletes all tasks then turns on motor A for 2 seconds and turns it off.
Hints: Use this to stop tasks that may still be in progress. The Task Number modifier is only necessary if you want to stop a certain task and not all tasks. This piece of code turns on motor A and lamp B. If 6 seconds pass and the touch sensor has not been pressed, the RCX will play a noise and turn off lamp B. Then both tasks will be restarted from the task split.. If the touch sensor is pressed within 6 seconds, both tasks will be stopped and the program ends.
Hints: Use this to define a subroutine. This does NOT start the subroutine. Each subroutine needs its own end (stoplight) icon. The main task will continue running by itself until a Run Sub command is reached. This piece of code turns on motor A. After 4 seconds it plays 3 notes and then turns off the motor.
Hints: Use this to start a subroutine. You must define the subroutine before using this command. This piece of code turns on motor A. After 4 seconds it plays 3 notes and then turns off the motor.
Hints: Use this in direct mode ONLY. Use this icon to clear RCX of any subroutines it previously had. This piece of code clears the RCX of any subroutines and then turns on motor A for 2 seconds and turns it off.
Hints: Hints: Use this icon to assign a task priority over other tasks. The highest priority is 255. The lowest is 0 (this is a change from previous versions of ROBOLAB).Tasks with lower priority will not run until the higher priority task has a wait statement. This command is useful if multiple tasks are trying to control the same motor. In this program, the top task has a higher priority (255) than the lower task (0). When the program is run, motor A will turn on in the backward direction. If the touch sensor is pressed within 8 seconds, the motor will then turn on in the forward direction for two seconds and then shut off. After 8 seconds (total) a sound will play.