Vex V5 button switch

If I’m trying to connect a motor to a button on the controller what code would I use for that?

if(Controller1.ButtonL2.pressing()){
Motor.spin(forward, 12.0, voltageUnits::volt);
}
1 Like