Class SparkMaxWrapper

java.lang.Object
com.team2813.lib2813.vendor.rev.motor.SparkMaxWrapper
All Implemented Interfaces:
com.team2813.lib2813.control.Encoder, com.team2813.lib2813.control.Motor, com.team2813.lib2813.control.PIDMotor

public class SparkMaxWrapper extends Object implements com.team2813.lib2813.control.PIDMotor
  • Constructor Details

    • SparkMaxWrapper

      public SparkMaxWrapper(int deviceId, SparkLowLevel.MotorType type, com.team2813.lib2813.control.InvertType invertType)
      Create a new object to control a SPARK MAX motor Controller
      Parameters:
      deviceId - The device ID.
      type - The motor type connected to the controller. Brushless motor wires must be connected to their matching colors and the hall sensor must be plugged in. Brushed motors must be connected to the Red and Black terminals only.
      invertType - Whether the motor is inverted
  • Method Details

    • set

      public void set(com.team2813.lib2813.control.ControlMode controlMode, double demand)
      Specified by:
      set in interface com.team2813.lib2813.control.Motor
    • set

      public void set(com.team2813.lib2813.control.ControlMode controlMode, double demand, double feedForward)
      Specified by:
      set in interface com.team2813.lib2813.control.Motor
    • getPositionMeasure

      public Angle getPositionMeasure()
      Specified by:
      getPositionMeasure in interface com.team2813.lib2813.control.Encoder
    • getAppliedCurrent

      public Current getAppliedCurrent()
      Specified by:
      getAppliedCurrent in interface com.team2813.lib2813.control.Motor
    • stopMotor

      public void stopMotor()
      Specified by:
      stopMotor in interface com.team2813.lib2813.control.Motor
    • setPosition

      public void setPosition(Angle position)
      Specified by:
      setPosition in interface com.team2813.lib2813.control.Encoder
    • getVelocityMeasure

      public AngularVelocity getVelocityMeasure()
      Specified by:
      getVelocityMeasure in interface com.team2813.lib2813.control.Encoder
    • configPIDF

      public void configPIDF(int slot, double p, double i, double d, double f)
      Specified by:
      configPIDF in interface com.team2813.lib2813.control.PIDMotor
    • configPIDF

      public void configPIDF(double p, double i, double d, double f)
      Specified by:
      configPIDF in interface com.team2813.lib2813.control.PIDMotor
    • configPID

      public void configPID(int slot, double p, double i, double d)
      Specified by:
      configPID in interface com.team2813.lib2813.control.PIDMotor
    • configPID

      public void configPID(double p, double i, double d)
      Specified by:
      configPID in interface com.team2813.lib2813.control.PIDMotor
    • addFollower

      public void addFollower(int deviceId, SparkLowLevel.MotorType type, com.team2813.lib2813.control.InvertType invertType)