FTC Motor Control
This page will help teams that may be new to FTC begin by starting with basic motor movement and then working them through the various different ways to control such a motor.
Setting up your development environment.
Setting up your motor
Here you can see how we can create a new motor in our hardware map
public class tutorial extends LinearOpMode {
// motor declaration, we use the
// Ex version as it has velocity measurements
DcMotorEx motor;
@Override
public void runOpMode() throws InterruptedException {
// the string is the hardware map name
motor = hardwareMap.get(DcMotorEx.class, "arm");
// use braking to slow the motor down faster
motor.setZeroPowerBehavior(DcMotor.ZeroPowerBehavior.BRAKE);
// disables the default velocity control
// this does NOT disable the encoder from counting,
// but lets us simply send raw motor power.
motor.setMode(DcMotor.RunMode.RUN_WITHOUT_ENCODER);
waitForStart();
}
}Getting the motor moving.
Closing the Loop on our motor
Last updated
Was this helpful?
