Class CANEncoder


  • public class CANEncoder
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      CANEncoder​(CANSparkMax device)
      Constructs a CANPIDController.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double getPosition()
      Get the position of the motor.
      double getVelocity()
      Get the velocity of the motor.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CANEncoder

        public CANEncoder​(CANSparkMax device)
        Constructs a CANPIDController.
        Parameters:
        device - The Spark Max to which the encoder is attached.
    • Method Detail

      • getPosition

        public double getPosition()
        Get the position of the motor. This returns the native units of 'rotations'.
        Returns:
        Number of rotations of the motor
      • getVelocity

        public double getVelocity()
        Get the velocity of the motor. This returns the native units of 'RPM'.
        Returns:
        Number the RPM of the motor