Problem assigning buttons on V5 remote for vex block code

Newbie coach and team. TIA for any help. Student havign trouble with the following:

  • identifying preasigned buttons for ports on remote

  • How to assign 2 motors to one button. He’s search the web and vex forum without luck.
    Any direction you can give would be appreciated!

Just program the code with an if statement if the button is pressed, activate the desired motors. What code platform are you using?

He’s using vexcode- block

the main problem is assigning 2 motors to one button. Thanks again

@James6555 already answered.
psudo code
if (buttonA pressed)
{
run motor1;
run moter2;

}

To maybe clarify what others are saying, the interface where you set up your controller as a device and map buttons to a motor will not allow you to map more than one motor to a button pair. You will need to direct your students to make custom user control code using if , else if, else. Like this:

forumhelp02

You may also add, above the forever loop, statements that set the velocity and braketype you want for each motor.

edit: the else if arm2 should be set to reverse.

2 Likes

You can also use events.

image

I wouldn’t use the preassigned ports.

This will work fine with the competition template, as it will only allow the controller to function at all within driver.

1 Like

Thanks all. Super helpful. He was able to get it to work…thanks!

1 Like