Go to Post What is this? PVC pirates with no visible PVC? (at least that I can see) IMPOSTORS! - theawesome1730 [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 24-03-2004, 18:02
Allison Allison is offline
Registered User
AKA: Allison Phelps
FRC #1024 (Kil-A-Bytes)
Team Role: Engineer
 
Join Date: Apr 2003
Rookie Year: 2003
Location: Indianapolis, IN
Posts: 94
Allison has a brilliant futureAllison has a brilliant futureAllison has a brilliant futureAllison has a brilliant futureAllison has a brilliant futureAllison has a brilliant futureAllison has a brilliant futureAllison has a brilliant futureAllison has a brilliant futureAllison has a brilliant futureAllison has a brilliant future
switching modes

in STL we only had one autonomous mode so we could only set up on the left side of the field. i have written more programs but i don't know or understand how to write the code to switch between different modes. i have written 4 mode (includes right and left). i would prefer to be able to switch modes from the OI but am open to doing it anyway possible. i need something i know will work since we accedently left the robot controller on the robot so i have no way of testing it before our next regional.

thankyou so much
allison
  #2   Spotlight this post!  
Unread 24-03-2004, 19:24
Unsung FIRST Hero
miketwalker miketwalker is offline
Robot Lifeguard
FRC #1902 (Exploding Bacon)
 
Join Date: Dec 2001
Rookie Year: 2002
Location: Orlando, FL
Posts: 878
miketwalker has a reputation beyond reputemiketwalker has a reputation beyond reputemiketwalker has a reputation beyond reputemiketwalker has a reputation beyond reputemiketwalker has a reputation beyond reputemiketwalker has a reputation beyond reputemiketwalker has a reputation beyond reputemiketwalker has a reputation beyond reputemiketwalker has a reputation beyond reputemiketwalker has a reputation beyond reputemiketwalker has a reputation beyond repute
Send a message via AIM to miketwalker
Re: switching modes

Well, I believe the OI can't send data inputs to the RC during autonomous. However, if you put 2 switches on your RC and plug them into the "Digital Inputs"... simply make one code, with all 4 modes on it. Make one switch the side switch (i.e. when on run Left side, when off run Right side code) and the other switch can choose between 2 modes... if you want to do 4 modes like you said, you can do more digital inputs with switches to choose. Then just in your code make IF loops to pick the code. Tell me if this makes sense, I'm kind've tired so I don't know if I make any sense.
__________________
Chopsaw? Chopsaw.
  #3   Spotlight this post!  
Unread 24-03-2004, 19:50
Max Lobovsky's Avatar
Max Lobovsky Max Lobovsky is offline
Fold em oval!
FRC #1257 (Parallel Universe)
Team Role: College Student
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Scotch Plains, NJ
Posts: 1,026
Max Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant futureMax Lobovsky has a brilliant future
Send a message via AIM to Max Lobovsky
Re: switching modes

You can in fact use the OI [edit] apparently im wrong about the rest of what i said i trust 10inthecrunch's explanation better than my own [/edit]
__________________
Learn, edit, inspire: The FIRSTwiki.
Team 1257


2005 NYC Regional - 2nd seed, Xerox Creativity Award, Autodesk Visualization Award
2005 Chesapeake Regional - Engineering Inspiration Award
2004 Chesapeake Regional - Rookie Inspiration award
2004 NJ Regional - Team Spirit Award

Last edited by Max Lobovsky : 24-03-2004 at 20:12.
  #4   Spotlight this post!  
Unread 24-03-2004, 19:58
10intheCrunch's Avatar
10intheCrunch 10intheCrunch is offline
Who's John V-Neun?
AKA: Alex Baxter
None #0254 (Cheesy Poofs)
Team Role: College Student
 
Join Date: Feb 2004
Rookie Year: 2004
Location: San Jose, CA
Posts: 129
10intheCrunch is a jewel in the rough10intheCrunch is a jewel in the rough10intheCrunch is a jewel in the rough10intheCrunch is a jewel in the rough
Send a message via AIM to 10intheCrunch
Re: switching modes

We use switches this year on our OI. The robot and OI are in full communication when you set them out on the field (just PWM and relay outputs are squelched), and inputs are only set to neutral when you go into autonomous. So, to do this: figure out which digital inputs you want to use, and in your program, capture the *previous* values of those inputs (the program makes one more sweep with neutral values, so you need the good ones from before that).

Basically just set up variables for the previous values and set them at the bottom of User_Routines, and in your Main function, create a variable that amalgamates those variables. Now you have one variable you can use for a switch statement in your autonomous code.

PM or IM me if you have trouble getting it to work, its a little difficult to explain in a static post .
__________________
~Alex Baxter
Programming, Arms operation, Team 254
  #5   Spotlight this post!  
Unread 24-03-2004, 20:18
Joshua May's Avatar
Joshua May Joshua May is offline
Go Bears!
FRC #1110 (Binary Bulldogs)
Team Role: College Student
 
Join Date: Nov 2003
Rookie Year: 2003
Location: Berkeley, CA
Posts: 1,306
Joshua May has a reputation beyond reputeJoshua May has a reputation beyond reputeJoshua May has a reputation beyond reputeJoshua May has a reputation beyond reputeJoshua May has a reputation beyond reputeJoshua May has a reputation beyond reputeJoshua May has a reputation beyond reputeJoshua May has a reputation beyond reputeJoshua May has a reputation beyond reputeJoshua May has a reputation beyond reputeJoshua May has a reputation beyond repute
Send a message via AIM to Joshua May
Re: switching modes

Last year we used a switch wired into the RC to tell whether we would turn left or right. I am not sure about whether or not we used one program, or had it switch between two programs. I was not the programmer last year, but I may have heard from our previous programmer that it switched between two different programs.
__________________
The FIRST Wiki - openFIRST - Ultimate Robot Challenge - URC Wiki
I currently have 50 GMail invites, PM or email me for one.
UC Berkeley Class of 2009

2005 Las Vegas Regional Autodesk Visualization Award
2005 Las Vegas Regional #8 Seeded Alliance with 988 and 1505
2006 Southern California Regional #15 seed
  #6   Spotlight this post!  
Unread 06-04-2004, 12:54
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Re: switching modes

And it turns out that Main.c is messed up. when Auton is set, it does one run of Process_Data_From_Master_uP() before doing Auton. I'll post a fix if anyone wants it.
  #7   Spotlight this post!  
Unread 06-04-2004, 12:59
Ryan M. Ryan M. is offline
Programming User
FRC #1317 (Digital Fusion)
Team Role: Programmer
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Ohio
Posts: 1,508
Ryan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud of
Re: switching modes

Quote:
Originally Posted by Astronouth7303
And it turns out that Main.c is messed up. when Auton is set, it does one run of Process_Data_From_Master_uP() before doing Auton. I'll post a fix if anyone wants it.
Yeah, I had noticed that. I actually fixed it in our code. Personally, I feel that the framework they gave us was badly designed, but whatever.
__________________

  #8   Spotlight this post!  
Unread 06-04-2004, 13:30
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Re: switching modes

Better than nothing.
  #9   Spotlight this post!  
Unread 06-04-2004, 13:37
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Re: switching modes

Here's what we're talking about:
Code:
void main (void)
{
#ifdef UNCHANGEABLE_DEFINITION_AREA
  IFI_Initialization ();        /* DO NOT CHANGE! */
#endif

  User_Initialization();        /* You edit this in user_routines.c */

  statusflag.NEW_SPI_DATA = 0;  /* DO NOT CHANGE! */ 

  while (1)   /* This loop will repeat indefinitely. */
  {
#ifdef _SIMULATOR
    statusflag.NEW_SPI_DATA = 1;
#endif

    if (statusflag.NEW_SPI_DATA)      /* 26.2ms loop area */
    {                                 /* I'm slow!  I only execute every 26.2ms because */
                                      /* that's how fast the Master uP gives me data. */
      if (autonomous_mode)            /* DO NOT CHANGE! */
        User_Autonomous_Code();    //You edit this in user_routines_fast.c
      
      Process_Data_From_Master_uP();  //Used to be before the if
    }
    Process_Data_From_Local_IO();     /* You edit this in user_routines_fast.c */
                                      /* I'm fast!  I execute during every loop.*/
  } /* while (1) */
}  /* END of Main */
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
Alternative autonomous modes Jon Reese Programming 1 14-01-2004 13:17
high-low gear switching archiver 2001 8 23-06-2002 22:39
Team 45 Dual Motor Gear Switching Assembly WorkThoseBuns Motors 1 20-03-2002 19:27
switching joystick axis????? team222badbrad Technical Discussion 9 16-01-2002 23:07
[white paper] Dual Motor Gear Switching Assy Brandon Martus Motors 0 29-06-2001 12:56


All times are GMT -5. The time now is 22:21.

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