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