Package frc.robot.subsystems.swervedrive2.swervelib.encoders

## Class SparkMaxEncoderSwerve

- java.lang.Object
- - frc.robot.subsystems.swervedrive2.swervelib.encoders.SwerveAbsoluteEncoder
  - - frc.robot.subsystems.swervedrive2.swervelib.encoders.SparkMaxEncoderSwerve

-     public class SparkMaxEncoderSwerve
      extends SwerveAbsoluteEncoder

  SparkMax absolute encoder, attached through the data port.

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `com.revrobotics.AbsoluteEncoder` | `encoder` | The `AbsoluteEncoder` representing the duty cycle encoder attached to the SparkMax.

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `SparkMaxEncoderSwerve​(SwerveMotor motor)` | Create the `AbsoluteEncoder` object as a duty cycle.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `clearStickyFaults()` | Clear sticky faults on the encoder.
    `void` | `configure​(boolean inverted)` | Configure the absolute encoder to read from [0, 360) per second.
    `void` | `factoryDefault()` | Reset the encoder to factory defaults.
    `Object` | `getAbsoluteEncoder()` | Get the instantiated absolute encoder Object.
    `double` | `getAbsolutePosition()` | Get the absolute position of the encoder.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### encoder

          public com.revrobotics.AbsoluteEncoder encoder

      The `AbsoluteEncoder` representing the duty cycle encoder attached to the SparkMax.

  - ### Constructor Detail

    - #### SparkMaxEncoderSwerve

          public SparkMaxEncoderSwerve​(SwerveMotor motor)

      Create the `AbsoluteEncoder` object as a duty cycle. from the `CANSparkMax` motor.
      Parameters:
        `motor` - Motor to create the encoder from.

  - ### Method Detail

    - #### factoryDefault

          public void factoryDefault()

      Reset the encoder to factory defaults.
      Specified by:
        `factoryDefault` in class `SwerveAbsoluteEncoder`

    - #### clearStickyFaults

          public void clearStickyFaults()

      Clear sticky faults on the encoder.
      Specified by:
        `clearStickyFaults` in class `SwerveAbsoluteEncoder`

    - #### configure

          public void configure​(boolean inverted)

      Configure the absolute encoder to read from [0, 360) per second.
      Specified by:
        `configure` in class `SwerveAbsoluteEncoder`
      Parameters:
        `inverted` - Whether the encoder is inverted.

    - #### getAbsolutePosition

          public double getAbsolutePosition()

      Get the absolute position of the encoder.
      Specified by:
        `getAbsolutePosition` in class `SwerveAbsoluteEncoder`
      Returns:
        Absolute position in degrees from [0, 360).

    - #### getAbsoluteEncoder

          public Object getAbsoluteEncoder()

      Get the instantiated absolute encoder Object.
      Specified by:
        `getAbsoluteEncoder` in class `SwerveAbsoluteEncoder`
      Returns:
        Absolute encoder object.