Help with VExCode Blocks arm limiter code

Anybody have tips/ quick screenshot of straightforward code blocks that limit velocity / movement of a robot arm, such as limiting the arm to only move 30-40 degrees for more precise movement with the controller? My team is running out of time for skills contest next week, and they could use some solid tips . thx

For velocity you could do something like:

while (button pressed) {
motor.setVelocity(50, percent); 
}
else {
 motor.setVelocity(100, percent);
}

For specific degrees:

if (button pressed) {
motor.spinFor(30, degrees)
}

Not sure of the exact code.

2 Likes