is it best to put the autonomous code in a SUB? or have it in the main loop? if it is in the main loop, how do you stop it from running if you aren’t in autonomous mode? I read the article here:
We did it in a subroutine. That way, all we had to do was return at the end and thus we made sure we didn’t accidently have it do autonomous when we were supposed to drive.
I put ours in a sub and every function on our robot was in a sub and I always call all the subs, but at the top of the autonomous I put an if statement like this. if auton_mode = 0 then Return . This canceled the sub if we where not in autonomous mode.