View Single Post
  #16   Spotlight this post!  
Unread 26-04-2004, 17:25
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,906
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Multiple Auton's

Here are two ways teams I helped accomplished it this year.

1) Use a BCD style rotary switch available from Digi-Key (hooked to digital input pins 15-18 in this case). 16 choices using 4 digital input pins or 8 choices using 3 pins. The extra selections were used for diagnostic software rather than have so many autonomous programs.
Code:
static unsigned int swtc; //set equal to the switch input
 
swtc = PORTJ>>4; // Auto select switch 0-15
switch(swtc) 
{
	case 0: 
	default:
		AUTO_0();
		break;
 
	case 1: 
		AUTO_1();
		break;

}

2) Use a regular Radioshack style mechanical rotary switch. In this case a 6-position switch hooked to digital input pins 11-16.
Code:
if (!rc_dig_in11)
{
	 Auto_1();
}
else if (!rc_dig_in12)
{
	 Auto_2();
}
...
else
{
	 Auto_1();
}
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 26-04-2004 at 17:29.