How to configure rev through bore encoder FTC

How do I configure my rev through bore encoder on my control hub, do I declare it in the driver with the same name as the motor?, because its cable goes to the same port as the motor, so I don’t know if in my programming I declare it with the same name as the engine

Yup, pretty much. Whatever port you plug it into, that motor name in the hardware map is what is associates to. You can then use motor.getCurrentPosition() in the SDK to get the encoder reading.

For example if you plug the throughbore enocder into port 0 on the Control Hub, and motor 0 is a motor named “MyMotor”, then in code you get the motor with hardwareMap.dcMotor.get(“MyMotor”), then use motor.getCurrentPosition(); which returns the encoder count

See: Encoders - Game Manual 0

1 Like

Why does learn ROAD RUNNER have these lines then?

You are supposed to change those to correspond with what ports the odometry pods are plugged into. As in, if leftEncoder is plugged into a port with a motor named “MyMotor”, that line should be

leftEncoder = new Encoder(hardwareMap.get(DcMotorEx.class, "MyMotor"));

1 Like

thank you very much