Page 190 - CodePilot V5.0 C8
P. 190

This process  repeats  36 times  with the robot  making  small adjustments  (moving forward
                     by 60 mm and turning right by 10 degrees) to create a circular path.




                         CONTROL BLOCKS

                  Control blocks are used to determine when, how and how many times the robot should perform
                  an action. They help the robot make decisions, repeat actions and pause at the right moments.

                  Some of the important control blocks are as follows:

                           Block                                          Description

                   repeat block             It runs the enclosed code a set number of times.

                     repeat  10





                   while block              It keeps looping while the given condition stays true.

                     while





                   forever block            It repeats the block of code endlessly until you stop the program.

                     forever





                   wait until block         It pauses everything until the condition becomes true, then resumes

                                            execution.
                     wait until

                   if-then block            It executes the code only when the specified condition is true.

                     if      then






                   if-then-else block       This block  checks  a condition.  If the  condition is  true,  it  runs one
                                            set  of instructions;  if the condition  is false, it  runs another  set  of
                    if      then
                                            instructions.

                    else










                   188
                        CodePilot (V5.0)-VIII
   185   186   187   188   189   190   191   192   193   194   195