autonomus C++

Hi, any one can share some help on a autonomous in Vex C++? For some reason the program that my son is writing does not integrate the command on the robot and reads commands line by line instead of reading them as a whole function.
If it’s trying to go forward, it turns on only one motor in the base. Its as if each command only takes control of a certain motor and then does this to another one in the next command, it just cycles between the four motors on the base. We don’t know what’s causing this problem or how to fix it.

The program is using blocking functions, meaning that the program is waiting for the function to finish before moving on. You want to use the non-blocking versions of the motor control. This article may help:

It would help in the future to copy and paste a few line of the program as an example of the problem.

It doesn’t work… Do you have other idea? Can we share the autonomous to be evaluate by you?

void driveForward(double speed,double rotations){

Try doing something like this in the void pre auton if you’re using the competition template.
having the ,false at the end will stop allow all motors to move.

hope this’ll help

I’ll try it!!

I know whats going on. You cant have the moters run in time units

You have do




vex::task::sleep(1000); thats one second
You can use “fwd” or “rev”