Setting Velocity
Setting Velocity in our Program
Adding Ticks per Second as a Variable
public void runOpMode() {
leftmotor = hardwareMap.get(DcMotor.class, "leftmotor");
rightmotor = hardwareMap.get(DcMotor.class, "rightmotor");
rightmotor.setDirection(DcMotor.Direction.REVERSE);
leftmotor.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);
rightmotor.setMode(DcMotor.RunMode.STOP_AND_RESET_ENCODER);
int leftTarget = (int)(610 * COUNTS_PER_MM);
int rightTarget = (int)(610 * COUNTS_PER_MM);
double TPS = (175/60) * COUNTS_PER_WHEEL_REV;
waitForStart();Changing from Power to Velocity
DcMotor vs. DcMotorEx

Full Program
Last updated
Was this helpful?

