Reporter#

The Switch Reporter block is used to return a numeric value. These conditions are defined with Switch Python functions.

They are shaped to fit inside any blocks with circular inputs.

a VEXcode Switch Blocks Example showing a Switch Reporter Block#
([                               ] ::custom-switch)

Select the open space of the block indicated in the image here and begin typing.

Image showing the Switch Reporter block interface with a highlighted open space for inputting Python commands.

Switch Reporter blocks can be used for single lines of Switch Python functions that directly will report a numeric value.

Math functions can be used to calculate values within a Switch Reporter block. This includes, but is not limited to:

  • Addition: +

  • Subtraction: -

  • Division: /

  • Multiplication: *

a VEXcode Switch Blocks Example showing a Switch Reporter Block with python code that has an addition operator#
([drivetrain heading (degrees) + 45] ::custom-switch)

In order for a Switch Reporter block to function as intended, the Switch Python commands must be entered with the correct spelling, punctuation, and indentation. Refer to the Help of each block to see the matching Switch Python command.

In this example, the current X position of the robot in MM will be printed in the Print Console.

a VEXcode Switch Blocks Example showing a Switch Reporter Block within a print block#
when started :: hat events
print ([drivetrain heading (degrees) + 45]  ::custom-switch) ▶