edu.wpi.first.wpilibj
Class Victor
java.lang.Object
edu.wpi.first.wpilibj.SensorBase
edu.wpi.first.wpilibj.PWM
edu.wpi.first.wpilibj.SafePWM
edu.wpi.first.wpilibj.Victor
- All Implemented Interfaces:
- LiveWindowSendable, MotorSafety, IDevice, IDeviceController, PIDOutput, Sendable, SpeedController
public class Victor
- extends SafePWM
- implements SpeedController, IDeviceController
VEX Robotics Victor Speed Controller
Constructor Summary |
Victor(int channel)
Constructor that assumes the default digital module. |
Victor(int slot,
int channel)
Constructor that specifies the digital module. |
Method Summary |
double |
get()
Get the recently set value of the PWM. |
void |
pidWrite(double output)
Write out the PID value as seen in the PIDOutput base object. |
void |
set(double speed)
Set the PWM value. |
void |
set(double speed,
byte syncGroup)
Deprecated. For compatibility with CANJaguar
The PWM value is set using a range of -1.0 to 1.0, appropriately
scaling the value for the FPGA. |
Methods inherited from class edu.wpi.first.wpilibj.PWM |
enableDeadbandElimination, free, getChannel, getModuleNumber, getPosition, getRaw, getSmartDashboardType, getSpeed, getTable, initTable, setBounds, setPeriodMultiplier, setPosition, setRaw, startLiveWindowMode, stopLiveWindowMode, updateTable |
Methods inherited from class edu.wpi.first.wpilibj.SensorBase |
checkAnalogChannel, checkAnalogModule, checkDigitalChannel, checkDigitalModule, checkPWMChannel, checkPWMModule, checkRelayChannel, checkRelayModule, checkSolenoidChannel, checkSolenoidModule, getDefaultAnalogModule, getDefaultDigitalModule, getDefaultSolenoidModule, setDefaultAnalogModule, setDefaultDigitalModule, setDefaultSolenoidModule |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Victor
public Victor(int channel)
- Constructor that assumes the default digital module.
- Parameters:
channel
- The PWM channel on the digital module that the Victor is attached to.
Victor
public Victor(int slot,
int channel)
- Constructor that specifies the digital module.
- Parameters:
slot
- The slot in the chassis that the digital module is plugged into.channel
- The PWM channel on the digital module that the Victor is attached to.
set
public void set(double speed,
byte syncGroup)
- Deprecated. For compatibility with CANJaguar
The PWM value is set using a range of -1.0 to 1.0, appropriately
scaling the value for the FPGA.
- Set the PWM value.
- Specified by:
set
in interface SpeedController
- Parameters:
speed
- The speed to set. Value should be between -1.0 and 1.0.syncGroup
- The update group to add this Set() to, pending UpdateSyncGroup(). If 0, update immediately.
set
public void set(double speed)
- Set the PWM value.
The PWM value is set using a range of -1.0 to 1.0, appropriately
scaling the value for the FPGA.
- Specified by:
set
in interface SpeedController
- Parameters:
speed
- The speed value between -1.0 and 1.0 to set.
get
public double get()
- Get the recently set value of the PWM.
- Specified by:
get
in interface SpeedController
- Returns:
- The most recently set value for the PWM between -1.0 and 1.0.
pidWrite
public void pidWrite(double output)
- Write out the PID value as seen in the PIDOutput base object.
- Specified by:
pidWrite
in interface PIDOutput
- Parameters:
output
- Write out the PWM value as was found in the PIDController