com.qualcomm.robotcore.hardware

## Interface PwmControl

- All Known Implementing Classes:
    CRServoImplEx, ServoImplEx

      public interface PwmControl

  For hardware devices which are manipulated using a pulse width modulation (PWM) signal, the `PwmControl` interface provides control of the width of pulses used and whether the PWM is enabled or disabled.

  PWM is commonly used to control servos. `PwmControl` is thus found as a second interface on servo objects whose primary interface is `Servo` or `CRServo` when the underlying servo controller hardware supports this fine-grained control (not all servo controllers provide such control). To access the `PwmControl` interface, cast your `Servo` or `CRServo` object to `PwmControl`; however, it is usually prudent to first test whether the cast will succeed by testing using

      instanceof

  .
  See Also:
    `DcMotorEx`, Pulse-width modulation

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static class` | `PwmControl.PwmRange` PwmRange instances are used to specify the upper and lower pulse widths and overall framing rate for a servo.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `PwmControl.PwmRange` | `getPwmRange()` Returns the current PWM range limits for the servo
    `boolean` | `isPwmEnabled()` Returns whether the PWM is energized for this particular servo
    `void` | `setPwmDisable()` Individually denergizes the PWM for this particular servo
    `void` | `setPwmEnable()` Individually energizes the PWM for this particular servo.
    `void` | `setPwmRange(PwmControl.PwmRange range)` Sets the PWM range limits for the servo

- - ### Method Detail

    - #### setPwmRange

          void setPwmRange(PwmControl.PwmRange range)

      Sets the PWM range limits for the servo
      Parameters:
        `range` - the new PWM range limits for the servo
      See Also:
        `getPwmRange()`

    - #### getPwmRange

          PwmControl.PwmRange getPwmRange()

      Returns the current PWM range limits for the servo
      Returns:
        the current PWM range limits for the servo
      See Also:
        `setPwmRange(PwmRange)`

    - #### setPwmEnable

          void setPwmEnable()

      Individually energizes the PWM for this particular servo.
      See Also:
        `setPwmDisable()`, `isPwmEnabled()`

    - #### setPwmDisable

          void setPwmDisable()

      Individually denergizes the PWM for this particular servo
      See Also:
        `setPwmEnable()`

    - #### isPwmEnabled

          boolean isPwmEnabled()

      Returns whether the PWM is energized for this particular servo
      See Also:
        `setPwmEnable()`