Using Jumpers for autonomous in EasyC

We are using easy C for programming our Vortex. Can I use the jumpers to force the autonomous program to function differently when the robot is positioned differently on the field. I know we can use switches to perform this. But instead of jamming the switches shut for the different positions, we would like to just add or remove jumpers for the different positions.

Can anyone provide help or examples of how to do this.

Robot-X,

I will move your post to the *UNOFFICIAL Tech Support - Ask the Community *section of the forum. This will allow you to get a wider variety of feedback.

Regards.

-Eli

Robot-X:

Yes. You can use jumpers for the autonomous section to perform different autonomous.

My team has used this system more than switches because it saves you time on the field.

All you have to do is set the jumper variables (unsigned int, [variable name], 1) for every jumper that you will use. You can then use IFs to help the Cortex choose the correct autonomous.

I currently use 4 jumpers and I am able to perform more than 10 different routines within the file.

Hope this helps, if you need more info, be sure to ask :wink:

As has been mentioned, using Jumpers is definetly possible.

If you want to save ports, you can also use a potentiometer, with different positions for different routines. You would obviously need to set the values for your setup, but you would program it like:

if(value is between 100 and 500)
run auto #1
if(value is between 500 and 1000)
run auto #2
etc…

You would want the spot where the poti is for each routine to be in about the middle of each range.

IMHO the potentiometer is the more elegant and easier to use solution (turning an easy to reach “knob” instead of messing with the tiny jumpers). I’ve even seen designs where vex parts are used as an indicator or to lock the potentiometer on the setting you want.

Yes, indeed. Other teams in my club have used that method as well as with encoders, although I’m not sure if they got that last one working :confused: .

Encoders will not work for this purpose. Encoders measure relative position, or how much it has moved, but have no way to tell where they are located. When you turn on the robot, the encoder will read 0, no matter where it is actually turned to, and will increase as you move it.

Couldn’t they have turned on the robot and then turned the encoder to the desired position while disabled before autonomous?

I’m theory but it is a kind of ridiculous system where if they haven’t rezeroed the encoder before the match they have to reboot everything.

Why? If the encoder is only used for autonomous selection, then they just would make sure it is in the same position when they turn on their robot and then turn it to select the autonomous from there. No rezeroing or rebooting required.
I’m not saying that it’s a good system; I’m just saying it’s definitely possible.
If we are looking for the best solution, then my vote is for the LCD.

Yes, it could work, but it’s still a really silly solution, as you need to get to the field, turn on, and then move the encoder. Also, a potentiometer is much, much smaller and has sufficient friction that it holds it self easily in one spot with just an axle and a lock bar or similar to indicate its position.

The reason I don’t like the LCD (and an encoder for that matter as well) is that you need to get to the field, turn on, and then set your autonomous. With a poti you can set it beforehand or while queuing, put your robot on the field, and be ready to go. Also, if the robot were to disconnect briefly and reset, you would need to set the auto on the LCD again (if you notice it before the match starts), but the poti always stays in the same spot. But provided you don’t run into these rare issues, it works great for many people.

Unless you store the selection in flash memory, then each time the robot is turned on it can recall what has already been set. Did I ever post that code? Perhaps not, well guess I had better dig it out now.

Edit:
I only released for ConVEX.
https://vexforum.com/showpost.php?p=337593&postcount=23

It also worked in ROBOTC (different source) and would not be difficult (all relative I guess) to port to EasyC.

If you don’t have an LCD and want some feedback for what autonomous has been chosen then a speaker can do nicely.

Vex legal speaker telling you what autonomous has been chosen