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.
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.