Package edu.wpi.first.wpilibj.simulation
Class DutyCycleEncoderSim
java.lang.Object
edu.wpi.first.wpilibj.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
Constructs from a digital input channel.- Parameters:
channel- digital input channel.
-
-
Method Details
-
get
Get the position in turns.- Returns:
- The position.
-
set
Set the position.- Parameters:
value- The position.
-
getConnected
Get if the encoder is connected.- Returns:
- true if the encoder is connected.
-
setConnected
Set if the encoder is connected.- Parameters:
isConnected- Whether or not the sensor is connected.
-