Class DutyCycleEncoderSim
java.lang.Object
org.wpilib.simulation.DutyCycleEncoderSim
Class to control a simulated duty cycle encoder.
-
Constructor Summary
ConstructorsConstructorDescriptionDutyCycleEncoderSim(int channel) Constructs from a digital input channel.DutyCycleEncoderSim(DutyCycleEncoder encoder) Constructs from an DutyCycleEncoder object. -
Method Summary
Modifier and TypeMethodDescriptiondoubleget()Get the position in turns.booleanGet if the encoder is connected.voidset(double value) Set the position.voidsetConnected(boolean isConnected) Set if the encoder is connected.
-
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.
-