|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#16
|
|||||
|
|||||
|
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();
}
Last edited by Mark McLeod : 26-04-2004 at 17:29. |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
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 |