How do you get multitasking in V5 c++

I can’t seem to get my coding to work with the autonomous. Well, it does work, but it doesn’t do 2 actions at once, so I can’t get it to drive straight. This is my first time coding, so I’d like some help.

void autonomous( void ) {

There are 5 parameters you can youse for rotateTo and rotateFor

The parameters in order are: distance, distance units, speed, speed unit and waitForCompletion

An example of how you would use all 5 parameters to make 2 motors move at the same time:

Motor1.rotateFor(500, degrees, 50, percent, false);
Motor2.rotateFor(500, degrees, 50, percent, true);

The false at the end basically makes it go to the next line while doing it’s action so it will multitask

1 Like

Ah, thanks for the help. Now I can actually do something with my auton.

1 Like

:((((((((((((( why!
38 PM 21 PM|690x215

21 PM

Why is it just that one?

Your statements are binding.
Try using " startRotateFor " for the command and use
" rotateFor " for just the last command.

Blocking. Binding in programming usually refers to something else.

Fine you win.

(I am not good with my programming lingo)

didn’t work…

Probably because @EagleBots’s suggestion was unrelated to the compile problem that you have, and was related to a problem you’re going to run into when the compiling issue is solved.

What programming tool are you guys using? Robot Mesh Studio, VEXcode, and VEX Coding Studio all have commands that look like these, but there are minor differences between them. Such as if vex::degrees is defined or not.

1 Like

You have to break up the code using brackets per each step.

And then use a blocking statement for the last statement in every step.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.