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();
}