Class ServoChannel

java.lang.Object
com.revrobotics.servohub.ServoChannel

public class ServoChannel extends Object
  • Field Details

  • Method Details

    • getChannelId

      public ServoChannel.ChannelId getChannelId()
    • getPulseWidth

      public int getPulseWidth()
      Returns:
      The pulse width applied to this channel in microseconds.
    • isEnabled

      public boolean isEnabled()
      Returns:
      true if the channel is enabled; false, otherwise
    • getCurrent

      public double getCurrent()
      Returns:
      The channel's output current in Amps.
    • setPulseWidth

      public REVLibError setPulseWidth(int pulseWidth_us)
      Sets the servo to the desired location based on the pulse width (in microseconds)
      Parameters:
      pulseWidth_us - The desired pulse width in microseconds
    • setEnabled

      public REVLibError setEnabled(boolean enabled)
      Enables/Disables the servo
      Parameters:
      enabled - true = enabled, false = disabled
    • setPowered

      public REVLibError setPowered(boolean powered)
      Turns on/off the power to the servo
      Parameters:
      powered - true = powered on, false = powered off