This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Competition Switch

Read the switch positions of VEXnet Competition Switch or field controller

  • Library:
  • Simulink Coder Support Package for VEX EDR V5 Robot Brain

Description

The Competition Switch block is used to read the switch positions of the VEXnet Competition Switch, and provide the corresponding logical values (1 or 0) as outputs. This block can be used to enable the required logic for the Pre-Autonomous, Autonomous and Driver Controlled modes, based on the switch position.

Ports

Output

expand all

The output is 1 if the position of the switches are set at Enabled and Autonomous in the VEXnet Competetion Switch.

When the Auto output port is 1 and the Driver output port is 0, the robot is in Autonomous mode.

Data Types: Boolean

The output is 1 if the position of the switches are set at Enabled and Driver in the VEXnet Competition Switch.

When the Auto output port is 0 and the Driver output port is 1, the robot is in Driver mode.

Data Types: Boolean

The output is 1 if the position of the switch is set at Disabled in the VEXnet Competetion Switch.

Data Types: Boolean

The following table lists the modes and the three outputs based on the switch position.

Enable/Disable SwitchAutonomous/Driver SwitchModePre-AutoAutoDriver
DisableAutonomousPre-Autonomous100
EnableAutonomousAutonomous010
EnableDriverDriver Controlled001
DisableDriverDisabled000

Parameters

expand all

Specify how often the Competition Switch block should read the position of switches in VEXnet Competition Switch. The default value is 0.02 seconds.

See Also

Introduced in R2019a