Go to Post Smokey the Fisher Price motor says only YOU can prevent rule infractions. - artdutra04 [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 01-02-2007, 18:58
Happy Birthday! simpsonboy77 simpsonboy77 is offline
Registered User
AKA: Garrett Dicken
FRC #0041 (RoboWarriors)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2005
Location: New Jersey
Posts: 90
simpsonboy77 has a reputation beyond reputesimpsonboy77 has a reputation beyond reputesimpsonboy77 has a reputation beyond reputesimpsonboy77 has a reputation beyond reputesimpsonboy77 has a reputation beyond reputesimpsonboy77 has a reputation beyond reputesimpsonboy77 has a reputation beyond reputesimpsonboy77 has a reputation beyond reputesimpsonboy77 has a reputation beyond reputesimpsonboy77 has a reputation beyond reputesimpsonboy77 has a reputation beyond repute
Autonomous selector

I was wondering if there is a way to read from the OI, before autonomous, a value. We are coding multiple autonomous functions and I need a way to select which one to run. We can't put it on the robot because we have no inputs left. We have 1 completely unused port on the OI if that helps.
Thanks,
Garrett
Team 41
  #2   Spotlight this post!  
Unread 01-02-2007, 19:00
AdamHeard's Avatar
AdamHeard AdamHeard is offline
Lead Mentor
FRC #0973 (Greybots)
Team Role: Mentor
 
Join Date: Oct 2004
Rookie Year: 2004
Location: Atascadero
Posts: 5,511
AdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond repute
Send a message via AIM to AdamHeard
Re: Autonomous selector

When the robot is disabled before autonomous you can read the OI switches. Set a (static) variable from one of those switches, and then you can choose your mode from that in autonomous.

It's pretty similar to reading one off the robot.
  #3   Spotlight this post!  
Unread 01-02-2007, 19:01
6600gt's Avatar
6600gt 6600gt is offline
Registered User
AKA: Lohit
FRC #0226 (Hammerhead)
Team Role: Alumni
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Troy, MI
Posts: 221
6600gt is a jewel in the rough6600gt is a jewel in the rough6600gt is a jewel in the rough
Re: Autonomous selector

It's written by Kevin Watson. We used a slightly modified version of it.

Quote:
void auton_selector(void)
{
static char last_sw1;
static char last_sw2;

if(AUTON_UP == 1 && AUTON_UP != last_sw1)
{
if(auton_select < MAXAUTONROUTINES)
auton_select++;
else
auton_select=99;
}
if(AUTON_DN == 1 && AUTON_DN != last_sw2 && auton_select > 0)
{
if (auton_select == 94)
auton_select=MAXAUTONROUTINES;
else
auton_select--;
}
last_sw1 = AUTON_UP; //oneshot the trigger and top buttons
last_sw2 = AUTON_DN;

User_Mode_Byte = auton_select;

}
User_Mode_Byte is the user display on the OI. Use that little button to change to it.

AUTON_UP/DOWN are the defines to which a joystick button or something similar.

Last edited by 6600gt : 01-02-2007 at 19:04.
  #4   Spotlight this post!  
Unread 01-02-2007, 22:58
tdlrali tdlrali is offline
Registered User
FRC #0469 (Las Guerrillas)
Team Role: Programmer
 
Join Date: Sep 2006
Rookie Year: 2006
Location: MI
Posts: 377
tdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud oftdlrali has much to be proud of
Re: Autonomous selector

We put little switches (the ones that go from 0-9) on the robot and hook them up to the dig in. Before each match, we set the autonomous mode by hand.
  #5   Spotlight this post!  
Unread 01-02-2007, 23:25
Lil' Lavery Lil' Lavery is offline
TSIMFD
AKA: Sean Lavery
FRC #1712 (DAWGMA)
Team Role: Mentor
 
Join Date: Nov 2003
Rookie Year: 2003
Location: Philadelphia, PA
Posts: 6,640
Lil' Lavery has a reputation beyond reputeLil' Lavery has a reputation beyond reputeLil' Lavery has a reputation beyond reputeLil' Lavery has a reputation beyond reputeLil' Lavery has a reputation beyond reputeLil' Lavery has a reputation beyond reputeLil' Lavery has a reputation beyond reputeLil' Lavery has a reputation beyond reputeLil' Lavery has a reputation beyond reputeLil' Lavery has a reputation beyond reputeLil' Lavery has a reputation beyond repute
Send a message via AIM to Lil' Lavery
Re: Autonomous selector

Quote:
Originally Posted by tdlrali View Post
We put little switches (the ones that go from 0-9) on the robot and hook them up to the dig in. Before each match, we set the autonomous mode by hand.
We used click wheels like that (except our went much higher than 9) last year. We had two, one for starting position, and one for the autonomous "play". It worked really well for us, although we really ended up only using 3 plays of the many we had available.
You'll be seeing something more advanced this year though if all goes to plan
__________________
Being correct doesn't mean you don't have to explain yourself.
  #6   Spotlight this post!  
Unread 02-02-2007, 08:32
Bongle's Avatar
Bongle Bongle is offline
Registered User
FRC #2702 (REBotics)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2002
Location: Waterloo
Posts: 1,069
Bongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond reputeBongle has a reputation beyond repute
Send a message via MSN to Bongle
Re: Autonomous selector

We used a little toggle switch on the robot last year.

if(rc_dig_in01 == 0)
{
run_blocking_auton()
}
else
{
run_shooting_auton()
}
  #7   Spotlight this post!  
Unread 02-02-2007, 11:16
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,078
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
Re: Autonomous selector

Quote:
Originally Posted by simpsonboy77 View Post
We can't put it on the robot because we have no inputs left.
Team 41
You used all 18 digital I/O pins?! Holy cow batman.
  #8   Spotlight this post!  
Unread 02-02-2007, 11:39
6600gt's Avatar
6600gt 6600gt is offline
Registered User
AKA: Lohit
FRC #0226 (Hammerhead)
Team Role: Alumni
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Troy, MI
Posts: 221
6600gt is a jewel in the rough6600gt is a jewel in the rough6600gt is a jewel in the rough
Re: Autonomous selector

The code that I posted previously, written by Kevin Watson, allows you have have 254 autons, that can be seen in the user display(the number) of the OI! Beats soldering any switches... We have been using this for the last 4 years at all competitions.

Last edited by 6600gt : 02-02-2007 at 12:23.
  #9   Spotlight this post!  
Unread 02-02-2007, 15:14
Happy Birthday! simpsonboy77 simpsonboy77 is offline
Registered User
AKA: Garrett Dicken
FRC #0041 (RoboWarriors)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2005
Location: New Jersey
Posts: 90
simpsonboy77 has a reputation beyond reputesimpsonboy77 has a reputation beyond reputesimpsonboy77 has a reputation beyond reputesimpsonboy77 has a reputation beyond reputesimpsonboy77 has a reputation beyond reputesimpsonboy77 has a reputation beyond reputesimpsonboy77 has a reputation beyond reputesimpsonboy77 has a reputation beyond reputesimpsonboy77 has a reputation beyond reputesimpsonboy77 has a reputation beyond reputesimpsonboy77 has a reputation beyond repute
Re: Autonomous selector

Quote:
Originally Posted by Abwehr View Post
You used all 18 digital I/O pins?! Holy cow batman.
We used 16 of them, that only leaves 2 open. That can only make 4 combinations, but we need 5.


6600GT thanks for the tip. I'll be doing that this year as the selector. Thank you everyone for your help.
  #10   Spotlight this post!  
Unread 02-02-2007, 16:19
Kingofl337's Avatar
Kingofl337 Kingofl337 is offline
You didn't see anything....
AKA: Adam
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 1998
Location: Manchester, NH
Posts: 861
Kingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond repute
Send a message via Yahoo to Kingofl337
Re: Autonomous selector

Use the trigger and thumb to set the autonomous mode. Pull the trigger and goto the next number. You can have the OI display what mode you have selected.
__________________
FIRST Team 501 PowerKnights - Mentor
FIRST Team 40 Checkmate - Mentor Alum
FIRST Team 146 Blue Lightning - Alumni
  #11   Spotlight this post!  
Unread 02-02-2007, 16:34
woody's Avatar
woody woody is offline
Too much metal for one hand! \m/
FRC #0033 (Killer Bees)
Team Role: Alumni
 
Join Date: Jul 2006
Rookie Year: 2005
Location: Michigan
Posts: 90
woody is a splendid one to beholdwoody is a splendid one to beholdwoody is a splendid one to beholdwoody is a splendid one to beholdwoody is a splendid one to beholdwoody is a splendid one to beholdwoody is a splendid one to behold
Re: Autonomous selector

Do you have any analog inputs left? If so, you should be able to use a 5 position toggle switch with 5 different value resistors as a sort of multiplexor. Just read the analog value and determine auto mode that way.. i think. im no programmer though ; )
__________________
"The greatest of all mistakes is to do nothing because you can only do a little; do what you can." - Sir Sidney Smith
  #12   Spotlight this post!  
Unread 02-02-2007, 16:37
AdamHeard's Avatar
AdamHeard AdamHeard is offline
Lead Mentor
FRC #0973 (Greybots)
Team Role: Mentor
 
Join Date: Oct 2004
Rookie Year: 2004
Location: Atascadero
Posts: 5,511
AdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond repute
Send a message via AIM to AdamHeard
Re: Autonomous selector

Quote:
Originally Posted by woody View Post
Do you have any analog inputs left? If so, you should be able to use a 5 position toggle switch with 5 different value resistors as a sort of multiplexor. Just read the analog value and determine auto mode that way.. i think. im no programmer though ; )
We usedd this same technique to make rotary switches for our OI that used one analog input for various purposes and it works fine. The programming part of it is really simple as well.
  #13   Spotlight this post!  
Unread 02-02-2007, 17:56
sarcasticmadnes sarcasticmadnes is offline
Registered User
AKA: Christine Chen
FRC #0115 (Monta Vista Robotics Team)
Team Role: Alumni
 
Join Date: Jun 2005
Rookie Year: 2005
Location: Cupertino, CA
Posts: 31
sarcasticmadnes will become famous soon enough
Send a message via AIM to sarcasticmadnes
Re: Autonomous selector

Our team (MVRT) has a keypad that takes up one whole port. The keypad is coded in assembly and has its own circuit board and the lcd screen is powered by regular AA batteries. The keypad allows us to have 64 different autonomous positions and choose which alliance we are and which position we are in.
  #14   Spotlight this post!  
Unread 02-02-2007, 18:05
AdamHeard's Avatar
AdamHeard AdamHeard is offline
Lead Mentor
FRC #0973 (Greybots)
Team Role: Mentor
 
Join Date: Oct 2004
Rookie Year: 2004
Location: Atascadero
Posts: 5,511
AdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond repute
Send a message via AIM to AdamHeard
Re: Autonomous selector

Quote:
Originally Posted by sarcasticmadnes View Post
Our team (MVRT) has a keypad that takes up one whole port. The keypad is coded in assembly and has its own circuit board and the lcd screen is powered by regular AA batteries. The keypad allows us to have 64 different autonomous positions and choose which alliance we are and which position we are in.
Is it legal to use batteries like that?
  #15   Spotlight this post!  
Unread 02-02-2007, 18:19
thefro526's Avatar
thefro526 thefro526 is offline
Mentor for Hire.
AKA: Dustin Benedict
no team (EWCP, MAR, FRC 708)
Team Role: Mentor
 
Join Date: Aug 2006
Rookie Year: 2005
Location: New Jersey
Posts: 2,599
thefro526 has a reputation beyond reputethefro526 has a reputation beyond reputethefro526 has a reputation beyond reputethefro526 has a reputation beyond reputethefro526 has a reputation beyond reputethefro526 has a reputation beyond reputethefro526 has a reputation beyond reputethefro526 has a reputation beyond reputethefro526 has a reputation beyond reputethefro526 has a reputation beyond reputethefro526 has a reputation beyond repute
Send a message via AIM to thefro526 Send a message via MSN to thefro526
Re: Autonomous selector

Does anyone have any multiple autonomous code for easy-C?
__________________
-Dustin Benedict
2005-2012 - Student & Mentor FRC 816
2012-2014 - Technical Mentor, 2014 Drive Coach FRC 341
Current - Mentor FRC 2729, FRC 708
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
Help with Selector Switch Slick Programming 2 16-02-2005 16:09
[OCCRA]: hose clamps on drill transmissions' gear selector? greencactus3 OCCRA Q&A 1 06-10-2004 05:28
Beacon selector switch? How to find/make? Fen Programming 13 12-02-2004 16:31
Team selector switches on ISAAC Lloyd Burns Robotics Education and Curriculum 0 17-12-2002 08:32
Channel Selector David Kelly Technical Discussion 6 03-06-2001 01:15


All times are GMT -5. The time now is 23:56.

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