|
Re: How to set up mutiliple programs based on field location
The typical way to do this is to read the switches (whether on the robot or the Driver Station) at the beginning of Autonomous mode, then use a Case Structure to choose which code to run based on the input.
You can see an example of this behavior in the default Autonomous code. It is setup to use 2 switches attached to the Cypress PSOC on the Driver Station in order to select between straight, left Y or right Y. In the default code the Case Structure only effects a small portion of the code, but it is often wrapped around a larger chunk of code to switch between very different autonomous modes.
__________________
2007 Wisconsin Regional Highest Rookie Seed & Regional Finalists (Thanks 930 & 2039)
2008 MN Regional Semifinalists (Thanks 2472 & 1756)
2009 Northstar Regional Semifinalists (Thanks 171 & 525)
|