AnalogOutputSim

class wpilib.simulation.AnalogOutputSim(*args, **kwargs)

Bases: pybind11_builtins.pybind11_object

Class to control a simulated analog output.

Overloaded function.

  1. __init__(self: wpilib.simulation._simulation.AnalogOutputSim, analogOutput: wpilib._wpilib.AnalogOutput) -> None

Constructs from an AnalogOutput object.

Parameters

analogOutput – AnalogOutput to simulate

  1. __init__(self: wpilib.simulation._simulation.AnalogOutputSim, channel: int) -> None

Constructs from an analog output channel number.

Parameters

channel – Channel number

getInitialized() bool

Check whether this analog output has been initialized.

Returns

true if initialized

getVoltage() float

Read the analog output voltage.

Returns

the voltage on this analog output

registerInitializedCallback(callback: Callable[[str, HAL_Value], None], initialNotify: bool) wpilib.simulation._simulation.CallbackStore

Register a callback to be run when this analog output is initialized.

Parameters
  • callback – the callback

  • initialNotify – whether to run the callback with the initial state

Returns

the CallbackStore object associated with this callback

registerVoltageCallback(callback: Callable[[str, HAL_Value], None], initialNotify: bool) wpilib.simulation._simulation.CallbackStore

Register a callback to be run whenever the voltage changes.

Parameters
  • callback – the callback

  • initialNotify – whether to call the callback with the initial state

Returns

the CallbackStore object associated with this callback

resetData() None

Reset all simulation data on this object.

setInitialized(initialized: bool) None

Define whether this analog output has been initialized.

Parameters

initialized – whether this object is initialized

setVoltage(voltage: float) None

Set the analog output voltage.

Parameters

voltage – the new voltage on this analog output