public abstract class PWMSpeedController extends SafePWM implements SpeedController
PWM.PeriodMultiplier
kAnalogInputChannels, kAnalogOutputChannels, kDigitalChannels, kPCMModules, kPDPChannels, kPDPModules, kPwmChannels, kRelayChannels, kSolenoidChannels, kSystemClockTicksPerMicrosecond
DEFAULT_SAFETY_EXPIRATION
Modifier | Constructor and Description |
---|---|
protected |
PWMSpeedController(int channel)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
double |
get()
Get the recently set value of the PWM.
|
boolean |
getInverted()
Common interface for the inverting direction of a speed controller.
|
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 |
setInverted(boolean isInverted)
Common interface for inverting direction of a speed controller.
|
disable, Feed, getDescription, getExpiration, isAlive, isSafetyEnabled, setExpiration, setSafetyEnabled, stopMotor
enableDeadbandElimination, free, getChannel, getPosition, getRaw, getRawBounds, getSmartDashboardType, getSpeed, getTable, initTable, setBounds, setDisabled, setPeriodMultiplier, setPosition, setRaw, setRawBounds, setSpeed, setZeroLatch, startLiveWindowMode, stopLiveWindowMode, updateTable
checkAnalogInputChannel, checkAnalogOutputChannel, checkDigitalChannel, checkPDPChannel, checkPDPModule, checkPWMChannel, checkRelayChannel, checkSolenoidChannel, checkSolenoidModule, getDefaultSolenoidModule, setDefaultSolenoidModule
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
disable, stopMotor
protected PWMSpeedController(int channel)
channel
- The PWM channel that the controller is attached to. 0-9 are on-board, 10-19 are
on the MXP portpublic void set(double speed)
The PWM value is set using a range of -1.0 to 1.0, appropriately scaling the value for the FPGA.
set
in interface SpeedController
speed
- The speed value between -1.0 and 1.0 to set.public void setInverted(boolean isInverted)
setInverted
in interface SpeedController
isInverted
- The state of inversion true is invertedpublic boolean getInverted()
getInverted
in interface SpeedController
public double get()
get
in interface SpeedController