public abstract class PWMSpeedController extends SafePWM implements SpeedController
PWM.PeriodMultiplier
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 returning if a speed controller is in the inverted state or not.
|
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, Feed, getDescription, getExpiration, isAlive, isSafetyEnabled, setExpiration, setSafetyEnabled, stopMotor
enableDeadbandElimination, free, getChannel, getPosition, getRaw, getRawBounds, getSpeed, initSendable, setBounds, setDisabled, setPeriodMultiplier, setPosition, setRaw, setSpeed, setZeroLatch
addChild, getName, getSubsystem, setName, setName, setName, setSubsystem
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
disable, stopMotor
getName, getSubsystem, setName, setName, setSubsystem
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 double get()
get
in interface SpeedController
public void setInverted(boolean isInverted)
SpeedController
setInverted
in interface SpeedController
isInverted
- The state of inversion true is inverted.public boolean getInverted()
SpeedController
getInverted
in interface SpeedController