8

I'm trying to rotate the motor of an EV3 by an angle of 50°. I can't. How I can rotate a NXT/EV3 motor by a given angle using RobotC?

Ambo100
  • 17,591
  • 7
  • 78
  • 169
FDuarte
  • 295
  • 3
  • 8

1 Answers1

3

The command that you are looking for is setMotorTarget as shown in the documentation here.

Essentially, you need to set the target rotation for the motor in degrees and then wait for the movement to take place:

//Sets motorA target to 50 degrees at a speed of 100
setMotorTarget(motorA, 50, 100);
// Waits for movement to complete
waitUntilMotorStop(motorA);
jncraton
  • 40,265
  • 10
  • 119
  • 237