Using My Blocks in VEXcode GO

My Blocks is one of the block categories within VEXcode GO. Some other categories include Looks, Sound, Sensing, and Variables. My Blocks are used to create a sequence of blocks that can be used multiple times throughout a project.


How to Make a Block

VEXcode GO Toolbar with the My Blocks section shown and the Make a Block button highlighted.

Select ‘Make a Block’ from the My Blocks category.

VEXcode GO Make a Block menu is open and the name of the block has been changed to Drive in and is highlighted. The blue Ok button on the bottom right is highlighted.

Rename the block by entering in the ‘Block Name’ field, then select ‘OK.’


How to Customize a Block

Add an input (number)

VEXcode GO Make a Block menu is open and the name of the block is set to Drive in. A number input field has been added to the block and is now highlighted.

Select the, ‘Add an input (number)’ option from the ‘Make a Block’ screen. Rename the input by entering in the ‘number’ field, then select ‘OK.’

Add a input (Boolean)

VEXcode GO Make a Block menu is open and the name of the block is set to Drive in. A boolean input field has been added to the block and is now highlighted.

Select the, ‘boolean’ option from the ‘Make a Block’ screen. Rename the input by entering in the ‘boolean’ field, then select ‘OK.’

Add a label

VEXcode GO Make a Block menu is open and the name of the block is set to Drive in. A label field has been added to the block and is now highlighted.

Select the, ‘Add a label’ option from the ‘Make a Block’ screen. Rename the label by entering in the ‘Label Text’ field, then select ‘OK.’

Combine inputs and labels

VEXcode GO Make a Block menu is open and a custom block has been created. The block first reads Drive in, then has a number input field, and then ends with a label reading mm square. All together the custom block reads Drive in X mm square. The blue Ok button on the bottom right is highlighted.

Combine inputs and labels together in order to create a sequence of blocks, then select ‘OK.’


How to Delete Inputs / Labels

VEXcode GO Make a Block menu is open and the name of the block is set to Drive in. A number input field has been added to the block, and the Clear icon above it is highlighted.

To delete an input or label, select the ‘Clear’ icon on top of the input or label that you wish to remove.


How to Use the Define Block

VEXcode GO My Blocks Definition block is highlighted. It reads 'Drive in number mm square', and the number is a parameter that can be used in the block definition.

A parameter can now be used from the {Define} block once it is created.

The VEXcode GO My Blocks Definition block with a definition now added to it. The stack has a Repeat block set to 4, and a Drive for 200 mm block with a Turn for 90 degrees block both inside the Repeat block.

Attach additional blocks to the {Define} block.

The VEXcode GO My Blocks Definition block with the number parameter now used in the definition. The stack has a Repeat block set to 4, and a Drive for block above a Turn for 90 degrees block inside the repeat block. The number parameter has been placed into the Drive for block, so it now reads Drive forward for number mm.

Use parameters from the {Define} block.

VEXcode GO My Blocks Command block added below a When Started block. This command block will call the Drive in number mm square command. The number parameter is set to 300.

Use the [My Block] attached to the {When Started} block.


How to Use My Blocks

Driving in Squares Example

In the following example, the robot will use My Blocks to:

  • Drive forward in a 200 mm square.
  • Turn right 45 degrees.
  • Drive forward in a 300 mm square.

The {Define} hat block breaks down a procedure. In the following example, this {Define} hat block breaks down the blocks used to drive in a square a certain number of times. Drag arguments from the {Define} block to be used within the blocks in its Definition, as shown in this video.

VEXcode GO When Started block that has three blocks below it. First is a Drive in 200 mm square command block, then Turn right for 45 degrees, and then a Drive in 300 mm square command block.

Once the {Define} block is set, the newly created block can now be dragged and added to the {When Started} block to set parameters.

The previous VEXcode GO blocks stack using the Drive in number mm square command block shown side by side with the block's definition.

Once the parameters are changed, the project is ready to be Download and Run.

For more information, help, and tips, check out the many resources at VEX Professional Development Plus

Last Updated: