Using My Blocks in VEXcode 123

My Blocks is one of the block categories within VEXcode 123. 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.

The following article will cover:


How to Make a Block

selectMakeABlock.png

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

make_a_block_1.png

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


How to Customize a Block

Add an input (number)

make_a_block_2.png

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)

make_a_block_3.png

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

make_a_block_4.png

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

make_a_block_5.png

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


How to Delete Inputs / Labels

make_a_block_6.png

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

defineoutline.png

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

attachmore.png

Attach additional blocks to the {Define} block.

movenumber.png

Use parameters from the {Define} block.

usemyblock.png

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


How to Use My Blocks

Driving in Squares Example

dragmyblock.png

In this example, the 123 Robot will use My Blocks to:

  • Drive forward in a 1 step square.
  • Turn right 45 degrees.
  • Drive forward in a 2 step 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.

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

download_and_run.png

Once the parameters are changed, the project is ready to be started.