VEXcode V5 - Two motors on one button

With the new VEXcode software, is there a way to set up two motors to run off of one button? Example: left and right intake motors both running one direction on the R1 button and running the other direction with the R2 button.

Yes, use Motor.spin() to get them both to spin at the same time

if(Button R1 pressed){
Left Roller Spin
Right Roller Spin
}
else if(Button R2 pressed){
Left Roller Spin Reversed
Right Roller Spin Reversed
}
else{
Left Roller Stop
Right Roller Stop
}

2 Likes

In which window do you make that change? The robot-config.cpp window is locked.

Well this code would go into the main.cpp file under driver control, if you are using the competition template. If not, put it in your int main loop

Look at this other post about Motor Groups:

1 Like

If you are going to use Motor Groups and Robot-config.cpp is locked, you can turn on expert robot configuration.

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