Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| " 2013 FRC Java API "
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## edu.wpi.first.wpilibj
Class Servo

    java.lang.Object
      edu.wpi.first.wpilibj.SensorBase
          edu.wpi.first.wpilibj.PWM
              edu.wpi.first.wpilibj.Servo

All Implemented Interfaces:
  LiveWindowSendable, IDevice, Sendable

    public class Servo

extends PWM
implements IDevice

Standard hobby style servo. The range parameters default to the appropriate values for the Hitec HS-322HD servo provided in the FIRST Kit of Parts in 2008.

Nested Class Summary

Nested classes/interfaces inherited from class edu.wpi.first.wpilibj.PWM
`PWM.PeriodMultiplier`

Field Summary

Fields inherited from class edu.wpi.first.wpilibj.PWM
`kDefaultPwmCenter, kDefaultPwmPeriod, kDefaultPwmStepsDown, kPwmDisabled`

Fields inherited from class edu.wpi.first.wpilibj.SensorBase
`kAnalogChannels, kAnalogModules, kDigitalChannels, kPwmChannels, kRelayChannels, kSolenoidChannels, kSolenoidModules, kSystemClockTicksPerMicrosecond`

Constructor Summary
`Servo(int channel)` Constructor that assumes the default digital module.
`Servo(int slot, int channel)` Constructor that specifies the digital module.

Method Summary
`double` | `get()` Get the servo position.
`double` | `getAngle()` Get the servo angle.
`String` | `getSmartDashboardType()`
`void` | `initTable(ITable subtable)` Initializes a table for this sendable object.
`void` | `set(double value)` Set the servo position.
`void` | `setAngle(double degrees)` Set the servo angle.
`void` | `startLiveWindowMode()` Start having this sendable object automatically respond to value changes reflect the value on the table.
`void` | `stopLiveWindowMode()` Stop having this sendable object automatically respond to value changes.
`void` | `updateTable()` Update the table for this sendable object with the latest values.

Methods inherited from class edu.wpi.first.wpilibj.PWM
`enableDeadbandElimination, free, getChannel, getModuleNumber, getPosition, getRaw, getSpeed, getTable, setBounds, setPeriodMultiplier, setPosition, setRaw`

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
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### Servo

    public Servo(int channel)

  Constructor that assumes the default digital module.

  Parameters:
    `channel` - The PWM channel on the digital module to which the servo is attached.

### Servo

    public Servo(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 to which the servo is attached.

Method Detail

### set

    public void set(double value)

  Set the servo position. Servo values range from 0.0 to 1.0 corresponding to the range of full left to full right.

  Parameters:
    `value` - Position from 0.0 to 1.0.

### get

    public double get()

  Get the servo position. Servo values range from 0.0 to 1.0 corresponding to the range of full left to full right.

  Returns:
    Position from 0.0 to 1.0.

### setAngle

    public void setAngle(double degrees)

  Set the servo angle. 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.

  Parameters:
    `degrees` - The angle in degrees to set the servo.

### getAngle

    public double getAngle()

  Get the servo angle. Assume that the servo angle is linear with respect to the PWM value (big assumption, need to test).

  Returns:
    The angle in degrees to which the servo is set.

### getSmartDashboardType

    public String getSmartDashboardType()

  Specified by:
    `getSmartDashboardType` in interface `Sendable`
  Overrides:
    `getSmartDashboardType` in class `PWM`
  Returns:
    the string representation of the named data type that will be used by the smart dashboard for this sendable

### initTable

    public void initTable(ITable subtable)

  Initializes a table for this sendable object.

  Specified by:
    `initTable` in interface `Sendable`
  Overrides:
    `initTable` in class `PWM`
  Parameters:
    `subtable` - The table to put the values in.

### updateTable

    public void updateTable()

  Update the table for this sendable object with the latest values.

  Specified by:
    `updateTable` in interface `LiveWindowSendable`
  Overrides:
    `updateTable` in class `PWM`

### startLiveWindowMode

    public void startLiveWindowMode()

  Start having this sendable object automatically respond to value changes reflect the value on the table.

  Specified by:
    `startLiveWindowMode` in interface `LiveWindowSendable`
  Overrides:
    `startLiveWindowMode` in class `PWM`

### stopLiveWindowMode

    public void stopLiveWindowMode()

  Stop having this sendable object automatically respond to value changes.

  Specified by:
    `stopLiveWindowMode` in interface `LiveWindowSendable`
  Overrides:
    `stopLiveWindowMode` in class `PWM`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| " 2013 FRC Java API "
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

"
For updated information see the Java FRC site
"