HOWWWWWWW?????

How would someone go about coding the robot to drive forward/backward and have the lift go up at the same time as it is driving in autonomous?
Has someone done this before? I can’t figure out how we can do this in our code, because it will make a big difference in our autonomous performance.
Thanks,
Any help would be appreciated!

Well… there is two ways of doing this… If you want the motors just to go 127 then just tell the arm motors to be activated at the same time as the drive. If the code requires a constant loop to hold the arm in a certain position, I would suggest using the multitasking method which is creating a task outside of the task main with the looped code, then activate it wilth the “StartTask();” function(I think that’s the correct way) then stop it with the “StopTask();” function.

task thing1m1t()
{
  int i = 0;
  while(i <= 100)
  {
    writeDebugStreamLine("Thing 1 is %d%% done.", i);
    wait1Msec(20);
    i++;
  }

  stopTask(thing1m1t);
}

void thing1m1()
{
  startTask(thing1m1t, kDefaultTaskPriority);
}

task thing2m1t()
{
  int i = 0;
  while(i <= 100)
  {
    writeDebugStreamLine("Thing 2 is %d%% done.", i);
    wait1Msec(20);
    i++;
  }

  stopTask(thing2m1t);
}

void thing2m1()
{
  startTask(thing2m1t, kDefaultTaskPriority);
}

bool thing2m2()
{
  static int i = 0;

  if(i <= 100)
  {
    writeDebugStreamLine("Thing 2 is %d%% done.", i);
    i++;
    return true;
  }

  return false;

}

bool thing1m2()
{
  static int i = 0;

  if(i <= 100)
  {
    writeDebugStreamLine("Thing 1 is %d%% done.", i);
    i++;
    return true;
  }

  return false;

}

task usercontrol()
{

  // User control code here, inside the loop

  // Method 1
  thing1m1();
  thing2m1();

  // Method 2
  while(true)
  {
    bool a = thing1m2();
    bool b = thing2m2();
    if(!a && !b) break;
    wait1Msec(20);
  }

  writeDebugStreamLine("Ding!");

  while (true)
  {
    UserControlCodePlaceholderForTesting();
  }
}

I made an oopsie on the method two last version, forgetting that an OR will ignore the subsequent conditions if the first one is true (short-circuiting), kind of a dumb mistake on my part actually. So the revised code looks as follows:

// Method 2
while(true)
{
  bool a = thing1m2();
  bool b = thing2m2();
  if(!a && !b) break;
  wait1Msec(20);
}