Go to Post Data is never ugly. It is only how you use it that can be. - Ed Law [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Spotlight this post!  
Unread 26-04-2004, 16:06
Joe Johnson's Avatar Unsung FIRST Hero
Joe Johnson Joe Johnson is offline
Engineer at Medrobotics
AKA: Dr. Joe
FRC #0088 (TJ2)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1996
Location: Raynham, MA
Posts: 2,648
Joe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond reputeJoe Johnson has a reputation beyond repute
Re: Multiple Auton's

We had the following code to use 2 pots on the OI to set the aunonomous mode.

Basically, we had 6 varieties of Auton (0-5). We had up to 15 steps per auton program (0-15). We could set the max number of steps as well as set the particular program.

The way it works is that your robot has to be not in AUTONOMOUS MODE, DISABLED and the OI has to be in USER MODE.

After that, you either are looking at the codes or you are setting the codes.


For our OI, we had two software disable switches in addition to the disable from the competition port (OIW_Enable_Sw and OIA_Enable_Sw). We used these switches to decide if we were in the "view autonomous" mode or the "set autonomous" mode. If both of these switches are in the "enabled" state, the program is in the "viewing" mode. If one or both switch is disabled, then the program is in the "setting" mode.

One pot sets the program number (OIW_RHW_Pot), the other sets the number of steps (OIA_Extra_Pot).

The display is as follows XXY where XX is the number of steps the particular program will run and Y is the auton program number -- I use this format because the number of steps is greater then 10 and the number of auton programs is not AND I need to have the entire number (XXY) be less than 255 or it would not display properly on the 3 digit display on the OI.

It is harder to explain than to use.

Below is the code fragment of where we set the codes we use in autonomous mode to select which program runs and how far it runs.

Finally, we also set these numbers to a safe condition upon reset so that we could simply cancel autonomous mode by simply hitting robot reset.

Joe J.

Quote:
if (!Enabled && user_display_mode && !autonomous_mode)
{
if (OIW_Enable_Sw == 0 || OIA_Enable_Sw == 0)
{
if ((OIA_Extra_Pot >> 4) < 16) auton_stop_cnt = OIA_Extra_Pot >> 4 ;
else auton_stop_cnt = 15 ;
if ((OIW_RHW_Pot >> 5) < 6) auton_prog_no = OIW_RHW_Pot >> 5 ;
else auton_prog_no = 5 ;
}
User_Mode_byte = (auton_stop_cnt *10) + auton_prog_no;
}

Last edited by Joe Johnson : 26-04-2004 at 16:22.
 


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
multiple definition error in MCC/Linker (possible bug?) wun Programming 5 01-04-2004 17:49
Multiple programs/autonomous routines galewind Programming 12 09-01-2004 22:25
question for teams created among multiple high schools archiver 2001 20 24-06-2002 03:58
multiple e-mail notifications srawls CD Forum Support 3 23-05-2002 12:55
Multiple Regional Winners and a little jab JamesJones General Forum 32 10-04-2002 23:38


All times are GMT -5. The time now is 16:52.

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