PWM.PeriodMultiplier
Modifier and Type | Field and Description |
---|---|
protected static double |
kDefaultMaxServoPWM |
protected static double |
kDefaultMinServoPWM |
Constructor and Description |
---|
Servo(int channel)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
double |
get()
Get the servo position.
|
double |
getAngle()
Get the servo angle.
|
void |
initSendable(SendableBuilder builder)
Initializes this
Sendable object. |
void |
set(double value)
Set the servo position.
|
void |
setAngle(double degrees)
Set the servo angle.
|
enableDeadbandElimination, free, getChannel, getPosition, getRaw, getRawBounds, getSpeed, 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
getName, getSubsystem, setName, setName, setSubsystem
protected static final double kDefaultMaxServoPWM
protected static final double kDefaultMinServoPWM
public void set(double value)
Servo values range from 0.0 to 1.0 corresponding to the range of full left to full right.
value
- Position from 0.0 to 1.0.public double get()
Servo values range from 0.0 to 1.0 corresponding to the range of full left to full right.
public void setAngle(double degrees)
Assume that the servo angle is linear with respect to the PWM value (big assumption, need to test).
Servo angles that are out of the supported range of the servo simply "saturate" in that direction In other words, if the servo has a range of (X degrees to Y degrees) than angles of less than X result in an angle of X being set and angles of more than Y degrees result in an angle of Y being set.
degrees
- The angle in degrees to set the servo.public double getAngle()
Assume that the servo angle is linear with respect to the PWM value (big assumption, need to test).
public void initSendable(SendableBuilder builder)
Sendable
Sendable
object.initSendable
in interface Sendable
initSendable
in class PWM
builder
- sendable builder