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
ConstructorDescriptionDutyCycleEncoderSim
(int channel) Constructs from a digital input channel.DutyCycleEncoderSim
(DutyCycleEncoder encoder) Constructs from an DutyCycleEncoder object. -
Method Summary
Modifier and TypeMethodDescriptiondouble
get()
Get the position in turns.boolean
Get if the encoder is connected.void
set
(double value) Set the position.void
setConnected
(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.
-