View Single Post
  #2   Spotlight this post!  
Unread 06-02-2011, 11:16
Vikesrock's Avatar
Vikesrock Vikesrock is offline
Team 2175 Founder
AKA: Kevin O'Connor
no team
Team Role: Engineer
 
Join Date: Mar 2006
Rookie Year: 2007
Location: Manchester, NH
Posts: 3,305
Vikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond reputeVikesrock has a reputation beyond repute
Send a message via AIM to Vikesrock Send a message via MSN to Vikesrock Send a message via Yahoo to Vikesrock
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)
Reply With Quote