Class DutyCycleEncoderSim

java.lang.Object
edu.wpi.first.wpilibj.simulation.DutyCycleEncoderSim

public class DutyCycleEncoderSim extends Object
Class to control a simulated duty cycle encoder.
  • Constructor Details

    • DutyCycleEncoderSim

      Constructs from an DutyCycleEncoder object.
      Parameters:
      encoder - DutyCycleEncoder to simulate
    • DutyCycleEncoderSim

      public DutyCycleEncoderSim(int channel)
      Constructs from a digital input channel.
      Parameters:
      channel - digital input channel.
  • Method Details

    • get

      public double get()
      Get the position in turns.
      Returns:
      The position.
    • set

      public void set(double value)
      Set the position.
      Parameters:
      value - The position.
    • getConnected

      public boolean getConnected()
      Get if the encoder is connected.
      Returns:
      true if the encoder is connected.
    • setConnected

      public void setConnected(boolean isConnected)
      Set if the encoder is connected.
      Parameters:
      isConnected - Whether or not the sensor is connected.