Autonomous Switching

Is there anyway a team can switch from a couple of autonomous without reprogramming ie. dipswitch possible with different wiring at all?

Thanks in advance :confused:

Sure. Even a simple jumper on any one of your digital inputs would work.
For example:


if (rc_dig_in01 == 1) // Can use a simple jumper to pick the autonomous to use
{
	 printf("This is Autonomous_1\r");
	 Autonomous_1();
}
else
{
	 printf("This is Autonomous_2\r");
	 Autonomous_2();
}

If you want more than 2 modes you can use multiple digital inputs(I like switches more than jumpers but they are essentially the same thing) 1 digital input gives you 2 possible modes, 2 inputs gives you 4, 3 gives you 8 etc.

Another thing you can do is if between the modes you just want to change one variable (ie a delay before the code executes) you can use a pot(potentiometer) connected to an analog input and then tie the input from the pot to a variable in your code.

If you have any other questions just ask.

would anybody happen to know how to make a jumper for the FRC robot controller? like, do we jump from ground to signal?

Yes, just connect signal to ground on a digital input with a jumper that avoids the +5v power pin or use a switch.

The Vex tournaments are restricted to jumpers, but FRC is not.

What do you use for your digital inputs to trigger one mode or another? Limit switches? Bumper switches? And do you use mechanical means to hold them in position (levers that lock the toggles into one position or another)? Or am I making this too complicated?

What we’ve been doing is putting a potentiometer on the Operator Interface, marking positions on it… and using it for autonomous selection. Even though your robot is disabled at the beginning of a match, it still reads what value the potentiometer is sending. This allows for unlimited autonomous modes.

The code is just saying that if the value is 0-50, then do one autonomous, and if it is between 50-100 do another, etc. or whatever values you want based on how many auto modes you have.

Cody,

I think that you are confusing FRC and FVC…

Mike

Yolande,

Just use the orange jumpers that came in your VEX kit…

Mike

You cannot use a potentiometer in Vex. There are none in the vex kits, so any other pot you get would not be a legal Vex part for competition. You can use the Orange jumpers like the previous post suggested. If you’ve misplaced these, you can use a limit switch with a rubber band or cable tie holding down the switch.

Just use the jumpers and it’s very trivial. If your microcontroller is in a relatively difficult to reach place, I suggest running some PWM extension cables so you can plug the jumpers in wherever is most convenient.

Sorry for the tedious n00bie questions – I’m not a programmer.

From your code below, I’m assuming that you use the digital input from one of the 16 analog/digital ports to store in your variable. If we want to use Ports #1 & 2 (easiest to distinguish in a hurry), I’m assuming that we would have to reconfigure these as digital inputs. Are there any caveats/disadvantages to doing this, as opposed to using ports #11-16 (already configured as digital inputs by default)?

Does your variable rc_dig_in01 have to be declared anywhere prior using it to store the results of your digital input?

If we want to read a jumper in the interrupt ports instead, what command do we use to access the input from them?

Finally, I’m still not seeing the advantage of switches over jumpers from this post. My mental picture of switches sees them as far more complicated than jumpers (attaching limit switches or bumpers and having to anchor them down). What am I missing?

Just to avoid confusing people who are reading this be aware that the example I showed was for programming through MPLAB rather than EasyC. You can do the same thing in EasyC it’s just a little different.

You can safely change the default configurations of inputs 1 & 2 to use those for jumpers.
With MPLAB You have to change: Set_Number_of_Analog_Channels(NO_ANALOGS);
The only issue that might change your mind is if you wanted to use an input for an analog sensor rather than digital. The way the Vex controller is designed any analog inputs you use are declared in order before your digital inputs.

If you use MPLAB to program your robot then rc_dig_in01 is defined.
In EasyC you’d drag in “Digital Inputs” from under “Inputs” to check your jumper.