How do you initialize multiple forever loops or while loops at once?

We have just started coding C++, and we are starting with VEXcode Pro V5. We have encountered an issue we couldn’t find a solution to. The we had multiple while loops(forever loops) and we want to initialize them at the same time for the driver control buttons to work. Here is a picture of our code:


We want the tank drive code and Intake R1 and R2 code to work and be able to spin the intake while driving. Is there a way to start both of these forever loops at the same time? Also, we have more code on the bottom, and we would also like to initialize the forever loops at the same time too.

Just use a single while loop.
ie. put the “if (Controller…” code inside the while loop with the drive code.

3 Likes

Thank you. We tried to use EZ template to add intake but it doesn’t work since we don’t know where to add pros::Motor intake(3, -4); we use two motor for intake.


To me it seems you should not be jumping into trying to use PROS and EZ-template until you have mastered the basics of the language.

6 Likes