SparkMaxPIDController_SetReference1

Function SparkMaxPIDController_SetReference1 

Source
pub unsafe extern "C" fn SparkMaxPIDController_SetReference1(
    this: *mut c_void,
    value: f64,
    ctrl: ControlType,
    pidSlot: c_int,
    arbFeedforward: f64,
    arbFFUnits: CANPIDController_ArbFFUnits,
) -> REVLibError
Expand description

Set the controller reference value based on the selected control mode.

@param value The value to set depending on the control mode. For basic duty cycle control this should be a value between -1 and 1 Otherwise: Voltage Control: Voltage (volts) Velocity Control: Velocity (RPM) Position Control: Position (Rotations) Current Control: Current (Amps). The units can be changed for position and velocity by a scale factor using setPositionConversionFactor().

@param ctrl Is the control type

@param pidSlot for this command

@param arbFeedforward A value from -32.0 to 32.0 which is a voltage applied to the motor after the result of the specified control mode. The units for the parameter is Volts. This value is set after the control mode, but before any current limits or ramp rates.

@return REVLibError::kOk if successful

@deprecated Use SparkMaxPIDController::SetReference(double, CANSparkMax::ControlType, int, double, SparkMaxPIDController::ArbFFUnits) instead