public abstract class PWMSpeedController extends SafePWM implements SpeedController
PWM.PeriodMultiplierDEFAULT_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, stopMotorenableDeadbandElimination, free, getChannel, getPosition, getRaw, getRawBounds, getSpeed, initSendable, setBounds, setDisabled, setPeriodMultiplier, setPosition, setRaw, setSpeed, setZeroLatchaddChild, getName, getSubsystem, setName, setName, setName, setSubsystemclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdisable, stopMotorgetName, getSubsystem, setName, setName, setSubsystemprotected 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 SpeedControllerspeed - The speed value between -1.0 and 1.0 to set.public double get()
get in interface SpeedControllerpublic void setInverted(boolean isInverted)
SpeedControllersetInverted in interface SpeedControllerisInverted - The state of inversion true is inverted.public boolean getInverted()
SpeedControllergetInverted in interface SpeedController