Go to Post Good programmers always find a better way to do something, especially when it's not obvious where those improvements can be found. - Mr. Lim [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 11-03-2003, 22:35
goegan31 goegan31 is offline
Registered User
#0064
 
Join Date: Jan 2003
Location: Highland High
Posts: 29
goegan31 is an unknown quantity at this point
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   Spotlight this post!  
Unread 12-03-2003, 08:20
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,562
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
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   Spotlight this post!  
Unread 12-03-2003, 10:59
mtrawls's Avatar
mtrawls mtrawls is offline
I am JVN! (John von Neumann)
#0122 (NASA Knights)
Team Role: Programmer
 
Join Date: Mar 2003
Location: Hampton, VA
Posts: 295
mtrawls is a splendid one to beholdmtrawls is a splendid one to beholdmtrawls is a splendid one to beholdmtrawls is a splendid one to beholdmtrawls is a splendid one to beholdmtrawls is a splendid one to beholdmtrawls is a splendid one to behold
Send a message via AIM to mtrawls
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
comp_mode is zero before the match and after the match (the last of which doesn't matter here). In the above code, we used the override switch to "lock" the selection -- any switch would work, however.
  #4   Spotlight this post!  
Unread 17-03-2003, 22:56
Jared Russell's Avatar
Jared Russell Jared Russell is offline
Taking a year (mostly) off
FRC #0254 (The Cheesy Poofs), FRC #0341 (Miss Daisy)
Team Role: Engineer
 
Join Date: Nov 2002
Rookie Year: 2001
Location: San Francisco, CA
Posts: 3,077
Jared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond repute
Or, get an 8 position rotary switch...it is hard to mess up with one of those.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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


All times are GMT -5. The time now is 12:35.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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