|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Multiple Programs
hey, My mentor thought that instead of using switches to decide between autonomous programs, that we should load all of oue programs into different slots (i beleive there are eight) and then choose which program we want to run. My questions are, how dod you load them into different slots, and, how do you choose which slot to run. Thanks.
|
|
#2
|
||||||
|
||||||
|
you still have to use switches to choose which program to run.
please read Innovations First's Multi-bank programming guide: http://www.innovationfirst.com/first..._Bank_Code.zip , then ask again if you have questions |
|
#3
|
||||
|
||||
|
Well, as was said, you'll still have to have something resembling a "switch" to choose between the different code slots (at least 3 since 2^3 = 8). To choose between this many programs in essentially binary logic, however, could be considered confusing to an operator (if he is not familar with it). If what you are looking for is a quick alternative, you might consider what we (team 122) did, which worked great for us at VCU.
Have some sort of pre-existing switch that will be set to 1 when it is time to choose the program (BEFORE the match starts), and then goes to 0, "locking" the program. What you use to select between the 8 (we added a mode that did nothing to make it 9), programs is use the joystick: full right and full reverse is 0, middle and full reverse is 1, full left and full reverse is 2 ... etc. Now all you have to do is make some labels or give the operator a sheet of paper with the configuration and which program it represents, and everything should flow smoothly. Here's some code that we used that worked for us. It takes advantage of the integer math of PBASIC: Code:
auton_choice var nib ... if (sw_override = 0) OR (comp_mode = 0) then skip_auton_set auton_choice = p1_x/90 auton_choice = p1_y/90 * 3 + auton_choice skip_auton_set |
|
#4
|
|||||
|
|||||
|
Or, get an 8 position rotary switch...it is hard to mess up with one of those.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Saving Data to EEPROM | Phil Roth | Programming | 28 | 27-03-2003 22:29 |
| Dashboard programs and the char variable | Ian W. | Programming | 13 | 26-06-2002 02:07 |
| question for teams created among multiple high schools | archiver | 2001 | 20 | 24-06-2002 03:58 |
| new scoring programs in white papers | archiver | 2001 | 4 | 23-06-2002 23:21 |
| Dashboard programs | archiver | 2000 | 6 | 23-06-2002 23:10 |