Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/www/team847.wildgardenseed.com/lib/smarty/Smarty_Compiler.class.php on line 270
FIRST Team 847 PHRED - Analog Mode Switch SubVI

Analog Mode Switch SubVI

 

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/www/team847.wildgardenseed.com/lib/smarty/Smarty_Compiler.class.php on line 270
Download: analog_mode_switch_subvi.zip
PHRED Drive

Goal:
This subVI is designed to read a switch for changing between multiple autonomous modes without having to download a new program before each match.

Theory of Operation:
The subVI is designed to be used with a custom analog switch box. It analyzes the voltage from the switch box connected to the 9201 Analog Module. It then converts the analog signal into an integer. The integer is output to other code. The output can be wired to a case structure. You may have to go into our subVI and change the values to match resistors in the switch box. Schematics for making your own switch box are included with the subVI.

Code for Analog Mode Switch subVI (6 position).Figure 1 - Code for Analog Mode Switch subVI (6 position).
Inputs and outputs for Analog Mode Switch subVI (6 position)Figure 2 - Inputs and outputs for Analog Mode Switch subVI (6 position).

Our Application:
We use this SubVI to switch autonomous modes without having to downloading new code.

Other Potential Applications:
Please contact Team 847 if you find other uses.

Hints and Warnings:

  • You may have to change the voltage values inside the subVI to match resistors in your box.
  • There are two versions of this subVI included in the zip file, analog_mode_switch_6pos(SubVI)-847v1.vi is for reading a six position switch, and analog_mode_switch_4pos(SubVI)-847v1.vi is for reading a four position switch. Schematics for making both the four and six position switches are included with the subVIs.

 

Download: analog_mode_switch_subvi.zip