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
-
Constructor Summary
ConstructorsConstructorDescriptionSparkMaxWrapper(int deviceId, SparkLowLevel.MotorType type, com.team2813.lib2813.control.InvertType invertType) Create a new object to control a SPARK MAX motor Controller -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFollower(int deviceId, SparkLowLevel.MotorType type, com.team2813.lib2813.control.InvertType invertType) voidconfigPID(double p, double i, double d) voidconfigPID(int slot, double p, double i, double d) voidconfigPIDF(double p, double i, double d, double f) voidconfigPIDF(int slot, double p, double i, double d, double f) voidset(com.team2813.lib2813.control.ControlMode controlMode, double demand) voidset(com.team2813.lib2813.control.ControlMode controlMode, double demand, double feedForward) voidsetPosition(Angle position) void
-
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:
setin interfacecom.team2813.lib2813.control.Motor
-
set
public void set(com.team2813.lib2813.control.ControlMode controlMode, double demand, double feedForward) - Specified by:
setin interfacecom.team2813.lib2813.control.Motor
-
getPositionMeasure
- Specified by:
getPositionMeasurein interfacecom.team2813.lib2813.control.Encoder
-
getAppliedCurrent
- Specified by:
getAppliedCurrentin interfacecom.team2813.lib2813.control.Motor
-
stopMotor
public void stopMotor()- Specified by:
stopMotorin interfacecom.team2813.lib2813.control.Motor
-
setPosition
- Specified by:
setPositionin interfacecom.team2813.lib2813.control.Encoder
-
getVelocityMeasure
- Specified by:
getVelocityMeasurein interfacecom.team2813.lib2813.control.Encoder
-
configPIDF
public void configPIDF(int slot, double p, double i, double d, double f) - Specified by:
configPIDFin interfacecom.team2813.lib2813.control.PIDMotor
-
configPIDF
public void configPIDF(double p, double i, double d, double f) - Specified by:
configPIDFin interfacecom.team2813.lib2813.control.PIDMotor
-
configPID
public void configPID(int slot, double p, double i, double d) - Specified by:
configPIDin interfacecom.team2813.lib2813.control.PIDMotor
-
configPID
public void configPID(double p, double i, double d) - Specified by:
configPIDin interfacecom.team2813.lib2813.control.PIDMotor
-
addFollower
public void addFollower(int deviceId, SparkLowLevel.MotorType type, com.team2813.lib2813.control.InvertType invertType)
-