Vision Sensor Aotonomous (vex pro)

Hello, I just got my vision sensor and I am trying to make it that in autonomous when it sees the red ball the robot will stop turning. I have already configured the vision sensor. I can’t figure out how to make it stop turning.

FrontLeft.spin(reverse);
BackLeft.spin(reverse);
FrontRight.spin(forward);
BackRight.spin(forward);

I want it to stop when it sees a red ball at a certain coordinate on the camera.

Reversing the directions will not make the robot stop if this is what you are trying to accomplish. Try something like this.

if ( visionsenor !see ball ) {
keep turning 
}
else {
stop
}

To stop motors from moving you can use motor1.stop();
You can find a list of functions for motors here.

1 Like

Is there any way that I can set a certain part of the camera that it will check or make it stop when it goes to an area on it?

FrontLeft.spin(reverse);
BackLeft.spin(reverse);
FrontRight.spin(forward);
BackRight.spin(forward);

if (vision20,SIG_Red); {
FrontLeft.stop();
BackLeft.stop();
FrontRight.stop();
BackRight.stop();
}

Also what did I do wrong here
It is giving me a bunch of errors

bruh you put a comma here:

and it needs to be
if (vision20.SIG_Red); {
also, it hurts that your not using a drivetrain.
also, it might need parenthesis. if it did then it would be
if (vision20.SIG_Red()); {
and finally, if you are talking about vexcode pro in the title please change it. it might get you more replies since no one uses vex PRO.

I’m not using a drivetrain because I am geared to 400 rpm and the turns won’t convert even when I change the ratio. Also thank you for the help

1 Like