View unanswered posts | View active topics It is currently Wed Oct 28, 2020 3:48 pm

Reply to topic  [ 2 posts ] 
Switching between RC and autonomous 
Author Message

Joined: Mon Feb 03, 2014 11:34 am
Posts: 5
Post Switching between RC and autonomous
How do we switch between autonomous and RC mode? I've created a challenge for my students but they can only use the RC mode for a short period of time and most of the time will be spent in autonomous. I am hoping they can switch in and out whenever they like.

Thu Apr 17, 2014 3:38 pm

Joined: Wed Jul 30, 2014 9:18 am
Posts: 5
Post Re: Switching between RC and autonomous
You can do this a couple of different ways, but I like to use multitasking to do it. Check out this forum post on multitasking:

You can write your manual joystick controls as one task, and your autonomous as a second task. Then use task main to simply start/stop the tasks as you wish. For example:

if (vexRT[Btn5U] == 1)
stopTask (joydrive);
startTask (autodrive);
if (vexRT[Btn6D] == 1)
stopTask (autodrive);
startTask (joydrive);

Put that into a while loop, and you'll be all set.

Good luck!

Sun Aug 17, 2014 1:14 am
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.