Use a potentiometer dial if you’re on a time crunch. It’s quite simple to use. This is an image of the dial I used on my robot last year. The “needle” of the dial is a standoff coupler that I put into a shaft collar. I had a HS 12-tooth gear (the small metal gear) between the shaft collars as a grip, which is not shown in the picture. The potentiometer’s axle insert should be tight enough that you don’t need to use shaft collars on the other side of the dial.
I do not know if it’s legal to use a decoration as labeling like shown below, but you can have a template that you place on the dial while you’re preparing the robot for a match to help put the dial in the correct setting, after which you remove the template and put it in your pocket or something.
How to set a potentiometer dial up:
Since a potentiometer is an analog sensor, it sends out one number out of a range of values as opposed to just 0s and 1s. You can thus set a certain range on the pot to correspond to an autonomous, and the very first thing your robot should do when the autonomous period begins is to read the potentiometer, and match the reading to the desired autonomous. Here’s pseudocode for it.
Assume that you have 4 autonomous routines (or 4 starting positions, for that matter). You thus have set 4 ranges to correspond to each routine or position. This code should be placed in the autonomous task of your program, rather than the pre-auton function.
if( pot_reading > lower_end_of_range_1 && pot_reading < upper_end_of_range_1)
//run autonomous routine #1
else if( pot_reading > lower_end_of_range_2 && pot_reading < upper_end_of_range_2)
//run autonomous routine #2
else if( pot_reading > lower_end_of_range_3 && pot_reading < upper_end_of_range_3)
//run autonomous routine #3
else if( pot_reading > lower_end_of_range_4 && pot_reading < upper_end_of_range_4)
//run autonomous routine #4
The following statement is optional, if you somehow want the robot to not run at all during autonomous)
else if( pot_reading > lower_end_of_range_5 && pot_reading < upper_end_of_range_5)
This pseudocode is “fire-and-forget”, i.e. once the routine is matched and begins to run, the robot will never refer to the potentiometer dial again for the remainder of the match, even if some impact during autonomous changes the setting on the dial.