Quick question. In PROS, how do I get all 4 wheelbase motors to spin at the same time (not one starting after the other one finishes) and then stop them all at the same time?
I know in VexCode there’s startRotateFor (starts the motor and moves onto the next line) and rotateFor (waits for rotation to finish) so how should I do this in PROS?
https://pros.cs.purdue.edu/v5/api/cpp/motors.html#move-relative
PROS V5 has an API reference website, and they also provide example code on how to do just that. The TL;DR of the example code is you just utilize while loops to block the code until the motor has reached a certain position. I don’t believe move_relative naturally causes the code to yield, meaning that code you posted should cause every motor to move at once.
Here’s a simple (and unrefined) driving function you could experiment with. As is evident by the manually created blocking clause, move relative is not blocking (it will do what you wanted).
As the PROS V5 Motors C++ API states, move_relative “simply sets the target for the motor, it does not block program execution until the movement finishes.” Basically, move_relative behaves the same as VexCode’s startRotateFor