How to make my code run simultaneously

I’m coding the autonomous period. However, the code runs one line each time. For example, it moves the LWheel then the RWheel. Is there a way so I could run them simultaneously?
image

yes, you need all but the last command to be non-blocking.
if you add a false to the end of a rotateFor command, it will not wait for completion before moving on to the next line of code. if you set it to true or just not include it at all as you’ve done here, it will wait for completion.

so basically, the command motor.rotateFor(forward, 500, degrees, **false**); will continue to the next line instead of waiting.

9 Likes

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