More Help With Tasks

Hey I have another question. How do I manage the separate tasks within the competition template? Like if I have a drive control and a velocity control task how do I do that within the competition.

The way you do this is called multitasking

What you do is you create separate tasks, say you have a drive and a flywheel code, this is what it would look like:

task drive ()
{
}

task flywheel ()
{
}

task usercontrol ()
{
while(true)
{
startTask (drive);
startTask (flywheel);
}
}

make sure to delete task main () too

Don’t put startTask inside a while loop without other code that only allows it to be called once.

Sorry Let me clear something up. I have separate tasks for different things at the moment. I was just wondering how I was supposed to put them into the competition template. With autonomous and the usercontrol tasks.

So if I have two tasks right now. one for drive control and one for velocity control. Do I just change the drive control to usercontrol and still keep the separate velocity control task or how does it work.

Changing the drive control to user control would work fine. You can just define more tasks and then start those tasks from usercontrol or autonomous. Keep in mind that if you have bStopTasksBetweenModes set to true, then you will have to restart all tasks in usercontrol, even if you already started them in autonomous.