Main Content

Competition Switch

Read the switch positions of VEXnet Competition Switch or field controller

Add-On Required: This feature requires the Simulink Coder Support Package for VEX EDR V5 Robot Brain add-on.

  • Competition Switch block

Libraries:
Simulink Coder Support Package for VEX EDR V5 Robot Brain / Gamepad

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.

Examples

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 Competition 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.

Version History

Introduced in R2019a