ROBOTC Help

Alright (my favorite word) I did something very similar. Here is what I did


task autonomous()
{
	if (SensorBoolean[DALeft])
		DefenseLeft();
	else if (SensorBoolean[DARight])
		DefenseRight();
	else
		OALeft();
}

Then up at the top I defined Defensive Left/Right and OA Left. The DA Right/Left are port names.

Thanks for your help!

Great job – it sounds good! If the routines are very different (which I can certainly see this year, with how the field is laid out) then it probably is best to have completely different functions for each autonomous routine, just like you have done.

And you are welcome!

~Jordan