vex jumpers

A question popped up and I searched on the Cheif Delphi forums and the vex forums but I couldn’t find any info on it. I’m wondering how you would program with jumpers in MPLab for the autonomous mode for the FVC game this year. Our team might want to have several autonomous programs in the same program, and to do this we would either need jumpers to tell which program we want or bumper/limit switches (which is more complicated).
Thanks in advance for any helpful information or links.

One way is to take a look at the value of certain digital inputs - those without a jumper will have a value of “1” and those with a jumper will have the value “0”. Then, at the very start of your program, determine the value of the digital inputs - let’s say you use 3 inputs, that will give you up to 8 different modes, depending on the jumpers. Each additional input doubles the number of modes.

Does that help??

Don

Hey cool, it works! thanks! I did have to do one thing though; I tried putting the jumpers in the digital/analog section of the microcontroller after changing the first 3 to digital inputs, but it turns out you have to put them in the interrupt ports (which are digital inputs anyway)

but again, thanks! :slight_smile:

One point about the inputs: All analog iunputs must have lower input numbers than any digital inputs or outputs.

So, the first (lowest numbered) ports are analog inputs, the next few are digital outputs, and the last few are digital inputs. Of ocurse, if you don’t have analog inputs or digital outputs, they can all be digital inputs, but…

…in most cases, your jumpered ports should be 16, 15, 14 etc.

Don

I have 2 more questions (sorry, I like MPLab but I’m new to using it with sensors and recievers.)

  1. How do you recieve data from 2 recievers in MPLab and…
  2. How would you program an optical shaft encoder in MPLab?

thanks in advance for help (we need it soon!)

  1. There are seperate names for the controlls on the second remote. I can’t remember them now, but if you look at the IFI aliases file you should be able to find them.
  2. If you’re using the VEX encoder it very simple. You need to connect your encoder output to one of the interupt ports on your robot. Then setup an intterupt handler that just increments a variable.

If you’re using non-VEX quadrature encoders you should look at Kevin’s encoder code from 2005(www.kevin.org/frc/2005).

I can’t seem to find any separate names for the second receiver, but I did see that there are 12 pwm inputs (7-12 possibly for the second transmitter/receiver?)…

…ah, yes, I changed one of the inputs to 12 and channel 6 of the second receiver controlled the motor that the first one was controlling originally at 6. Thanks for the help!