Help coding controller

Hi guys, I’m here to ask for some basic controller code, like joystick code and coding the buttons, since I’ve forgotten most of it. Help would be much appreciated, thanks!

Obligatory reminder that you should not be using Vex Coding Studio anymore

Coding a motor to spin when a button is pressed:

if(Controller button.pressing){
   Motor.spin;
}

Coding a motor to spin proportional to the joystick:

Motor.spin(forward,Controller.Axis2.position,percent);

I recommend reading the API: https://api.vexcode.cloud/v5/html/

9 Likes