UNOFFICIAL RESPONSE: 2 tasks at once in autonomous with robotc

Please post the current code you have to control those mechanisms so we can better help you.

You need to write the lifting part and the robot driving part as functions or tasks.

Write your functions in a separate file, copy over the pragma statements and delete everything else.
you must add


#include "yournewfile.c"

to the top of your main competition template file, right after the


 #include "Vex_Competition_Includes.c" 

line.

Then write your functions:

void driverobot()
{
commands here;
}

then in the autonomous section:

driverobot();

This way you can put multiple functions in the autonomous section and run them all at once.

Of course it can be done! You can run up to 10 tasks. Here is a blurb from a team doing skyrise. Independent tasks controlled the claw that held the skyrise piece, the motor slew rate, the sweeper arm to take the skytrise back and forth, and the arm to raise the arm to various heights.

Use global variables (or functions that set globals) to influence the tasks. Some PID routines were turned on and off for various things as well as set target positions for the various parts. You then have to wait for activities to get to the right spot which can get more complex than you want.

task autonomous()
{
	clawon = CLAW_STOP; // dont move claw

	startTask(hold_claw);
	startTask(MotorSlewRateTask);
	startTask (pid_sweep);
	startTask (TiltArm); // aka Arm PID

	sweep_pid_on=0;
	arm_pid_on=1;

	// move the arm up/down to the loading position
	Target_arm = LOADER_ARM;

You can take it from there…