Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 191 - CodePilot V5.0 C8
P. 191

    Block                                          Description
                      if-else if-else block   This block checks many conditions in order. If the first condition is true,

                        if       then         it runs one set of instructions. If not, it checks the next condition. If none
                                              are true, it runs the final set of instructions.

                       else if   then

                        else

                            VARIABLE BLOCKS

                     Variable blocks are used to store values and keep track of things like counts, scores or distances.
                     They can be created and used in projects to control how the robot behaves based on changing values.
                     These blocks are found under the Logic - Variables section in the Logic block category.
                     The Make a Variable button allows the creation of a new variable, which acts like a container that
                     stores a value (such as a number or text) and can change during the program.

                     Some of the important distance variables blocks are as follows:
                                   Block                                           Description
                     custom variable block               This block  refers to  a custom  variable  that  you  create  in

                                                         your project.
                       myVariable
                     set myVariable to block             This block assigns a value to the variable.

                       set  myVariable  to  1

                     change myVariable by block          This block  increases  (or decreases  if you  use  a  negative
                                                         number) the value of the variable by a specified amount.
                       change   myVariable  by  1

                            USING THE DRAWING BLOCKS IN VEXCODE VR

                     Drawing blocks in VEXcode VR allow drawing paths on the playground by controlling the robot’s
                     movement. It is a fun way to visually represent the robot’s journey as it moves along a path.

                     Some of the important distance drawing blocks are as follows:
                               Block                                          Description

                     move pen block             This block is used to control the position of the pen, typically in relation
                                                to the robot’s movement. The Pen is either up (not drawing) or down
                       move pen  down
                                                (drawing).

                                                                                                                      189
                                                                                     VEXcode VR: Drive, Sense and Create

| 186 187 188 189 190 191 192 193 194 195 196 |