Log in

View Full Version : Talon SRX Encoder


dukeeagle
08-02-2016, 17:40
We are trying to figure out how to get the number of rotations on our encoder through our CANTalon.
The FRC website offers a solution (https://wpilib.screenstepslive.com/s/3120/m/7912/l/85770-measuring-rotation-of-a-wheel-or-other-shaft-using-encoders) if you use the Encoder class, but we are doing it through the wpilib CANTalon class.
Here's what we have so far:

CANTalon frontLeft = new CANTalon(RobotMap.frontLeft);

public encoder(){
frontLeft.changeControlMode(ControlMode.Position);
frontLeft.setFeedbackDevice(FeedbackDevice.QuadEnc oder);
frontLeft.setPID(0.5, 0.001, 0.0);
frontLeft.enableControl();
}

Is there a way to do this through the CANTalon class? Help is much appreciated.

Ether
08-02-2016, 17:46
Have you looked at Section 20 of the Talon SRX Software Reference Manual (http://www.ctr-electronics.com/Talon SRX Software Reference Manual.pdf) ?