Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   How to set up mutiliple programs based on field location (http://www.chiefdelphi.com/forums/showthread.php?t=91081)

nyindojin 06-02-2011 11:08

How to set up mutiliple programs based on field location
 
During last year's competitions, I was able to see that teams were able to create switches for their robot which told the robot what to do based on their location on the field. Does anyone now how this is done or any clue about it or as to where to get information about such a thing? Is it electrical wiring or programming?

For example press a switch (or flip a switch) "A" (out of three) and the robot does only the things programmed for that switch.

Vikesrock 06-02-2011 11:16

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.

nyindojin 12-02-2011 12:21

Re: How to set up mutiliple programs based on field location
 
Thank you.


All times are GMT -5. The time now is 10:13.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi