Class AnalogInputSim
java.lang.Object
org.wpilib.simulation.AnalogInputSim
Class to control a simulated analog input.
-
Constructor Summary
ConstructorsConstructorDescriptionAnalogInputSim(int channel) Constructs from an analog input channel number.AnalogInputSim(AnalogInput analogInput) Constructs from an AnalogInput object. -
Method Summary
Modifier and TypeMethodDescriptionbooleanCheck if this analog input has been initialized.doubleGet the voltage.registerInitializedCallback(NotifyCallback callback, boolean initialNotify) Register a callback on whether the analog input is initialized.registerVoltageCallback(NotifyCallback callback, boolean initialNotify) Register a callback on the voltage.voidReset all simulation data for this object.voidsetInitialized(boolean initialized) Change whether this analog input has been initialized.voidsetVoltage(double voltage) Change the voltage.
-
Constructor Details
-
AnalogInputSim
Constructs from an AnalogInput object.- Parameters:
analogInput- AnalogInput to simulate
-
AnalogInputSim
Constructs from an analog input channel number.- Parameters:
channel- Channel number
-
-
Method Details
-
registerInitializedCallback
Register a callback on whether the analog input is initialized.- Parameters:
callback- the callback that will be called whenever the analog input is initializedinitialNotify- if true, the callback will be run on the initial value- Returns:
- the
CallbackStoreobject associated with this callback.
-
getInitialized
Check if this analog input has been initialized.- Returns:
- true if initialized
-
setInitialized
Change whether this analog input has been initialized.- Parameters:
initialized- the new value
-
registerVoltageCallback
Register a callback on the voltage.- Parameters:
callback- the callback that will be called whenever the voltage is changed.initialNotify- if true, the callback will be run on the initial value- Returns:
- the
CallbackStoreobject associated with this callback.
-
getVoltage
-
setVoltage
-
resetData
Reset all simulation data for this object.
-