Jumper Clip programming

Hi guys,

Our team realized that it would be necessary to have multiple autonomous programs so that we would be able to use the one best fitted with our alliance’s auton. When we were coding our robot, we figured the simplest thing to do to find a solution would be to code our autonomous program so that we use four jumper clips; two autons pairs for the left and right tile. To control our four different autonomous programs, as shown below. We added ‘if’ variables to indicate the different jumpers and what each one would do.

task autonomous()
{
if (SensorValue[jumperTwo]==1) // Jumper Clip 2 is in port 2//
{
cAuton (); //Left tile autonomous//
}

if (SensorValue[jumperThree]==1) // Jumper Clip 3 is in port 3//
{
	cAutonTwo(); // Right tile autonomous//
}
	
if(SensorValue [jumperFour]==1) // Jumper Clip 4 is in port 4//
{
	cAutonThree();// Simplified left tile autonomous//
}

if(SensorValue [jumperFive]==1) // Jumper Clip 5 is in port 5//
{
	cAutonFour(); // Simplified right tile autonomous//
}

}

For some reason, the code as shown above, is only triggering the jumperTwo and jumperThree auton correctly. When both of the other jumpers, instead of running the different code, it just repeats the code that should be triggered by jumperThree which runs the right tile autonomous.

We feel that the solution is right underneath our noses, but we still can’t figure it out. Please help!

-Major Trouble

Just stating the obvious… you only have one clip in the bot at a time, right? I don’t see anything within this code that would fail if you have only one clip in at a time. There is a space after SensorValue for the two that are not working… only thing at all odd.

Make sure you only use one.

Are the jumpers in digital ports? How did you configure them? If you configured them as “digital inputs” then you need to compare with 0 rather than 1, if you configured them as “touch sensor” inputs then the code should work.

Thank you for your replies, everyone!

Sorry for not making this clear initially, but we only use one jumper clip, which we move from port to port depending on which autonomous code we would like to use.

@jpearman Our jumpers were configured as digital inputs and when we changed them to touch sensors it worked!

Thank you all so much for all of your help! If you are on a team that’s competing, Major Trouble wishes you good luck :slight_smile: