Robots for Kids Teaching Children How to Build and Program LEGO Robots

Basics: Event Repeating
RCX Operations | Event Timing | Event Repeating | Inputs | Links

Graphical programming section showing how program icons are strung together to make a small light blink.

Loops and GoTos allow programmers to repeat instructions many times without having to write a set of steps for each instance.

Program #1 uses a loop. When the loop icon after the second timer is reached, the program goes back to the forward loop and runs through the steps again. It does this 14 times - the number in the box. You can set this number for as many times as you wish

If you don't know how long you will want to repeat a piece of code you can use a Goto. This command, shown in program #2, operates just like a loop except it will run until some other part of the program tells it to stop.

 


© 2004 M. Lichtenberg. Comments/questions: email robots4kids@bellsouth.net
robotsforkids.com is not affiliated in any way with The LEGO Corporation.
Home Basics First Robot Multisensor Communication Pneumatics Vision Lessons Classes