AnalogInputSim

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

Bases: pybind11_builtins.pybind11_object

Class to control a simulated analog input.

Overloaded function.

  1. __init__(self: wpilib.simulation._simulation.AnalogInputSim, analogInput: wpilib._wpilib.AnalogInput) -> None

Constructs from an AnalogInput object.

Parameters

analogInput – AnalogInput to simulate

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

Constructs from an analog input channel number.

Parameters

channel – Channel number

getAccumulatorCenter()int

Get the accumulator center.

Returns

the accumulator center

getAccumulatorCount()int

Get the accumulator count.

Returns

the accumulator count.

getAccumulatorDeadband()int

Get the accumulator deadband.

Returns

the accumulator deadband

getAccumulatorInitialized()bool

Check if the accumulator has been initialized.

Returns

true if initialized

getAccumulatorValue()int

Get the accumulator value.

Returns

the accumulator value

getAverageBits()int

Get the number of average bits.

Returns

the number of average bits

getInitialized()bool

Check if this analog input has been initialized.

Returns

true if initialized

getOversampleBits()int

Get the amount of oversampling bits.

Returns

the amount of oversampling bits

getVoltage()float

Get the voltage.

Returns

the voltage

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

Register a callback on the accumulator center.

Parameters
  • callback – the callback that will be called whenever the accumulator center is changed

  • initialNotify – if true, the callback will be run on the initial value

Returns

the CallbackStore object associated with this callback

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

Register a callback on the accumulator count.

Parameters
  • callback – the callback that will be called whenever the accumulator count is changed

  • initialNotify – if true, the callback will be run on the initial value

Returns

the CallbackStore object associated with this callback

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

Register a callback on the accumulator deadband.

Parameters
  • callback – the callback that will be called whenever the accumulator deadband is changed

  • initialNotify – if true, the callback will be run on the initial value

Returns

the CallbackStore object associated with this callback

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

Register a callback on whether the accumulator is initialized.

Parameters
  • callback – the callback that will be called whenever the accumulator is initialized

  • initialNotify – if true, the callback will be run on the initial value

Returns

the CallbackStore object associated with this callback

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

Register a callback on the accumulator value.

Parameters
  • callback – the callback that will be called whenever the accumulator value is changed

  • initialNotify – if true, the callback will be run on the initial value

Returns

the CallbackStore object associated with this callback

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

Register a callback on the number of average bits.

Parameters
  • callback – the callback that will be called whenever the number of average bits is changed

  • initialNotify – if true, the callback will be run on the initial value

Returns

the CallbackStore object associated with this callback

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

Register a callback on whether the analog input is initialized.

Parameters
  • callback – the callback that will be called whenever the analog input is initialized

  • initialNotify – if true, the callback will be run on the initial value

Returns

the CallbackStore object associated with this callback

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

Register a callback on the amount of oversampling bits.

Parameters
  • callback – the callback that will be called whenever the oversampling bits are changed

  • initialNotify – if true, the callback will be run on the initial value

Returns

the CallbackStore object associated with this callback

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

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 CallbackStore object associated with this callback

resetData()None

Reset all simulation data for this object.

setAccumulatorCenter(accumulatorCenter: int)None

Change the accumulator center.

Parameters

accumulatorCenter – the new center

setAccumulatorCount(accumulatorCount: int)None

Change the accumulator count.

Parameters

accumulatorCount – the new count.

setAccumulatorDeadband(accumulatorDeadband: int)None

Change the accumulator deadband.

Parameters

accumulatorDeadband – the new deadband

setAccumulatorInitialized(accumulatorInitialized: bool)None

Change whether the accumulator has been initialized.

Parameters

accumulatorInitialized – the new value

setAccumulatorValue(accumulatorValue: int)None

Change the accumulator value.

Parameters

accumulatorValue – the new value

setAverageBits(averageBits: int)None

Change the number of average bits.

Parameters

averageBits – the new value

setInitialized(initialized: bool)None

Change whether this analog input has been initialized.

Parameters

initialized – the new value

setOversampleBits(oversampleBits: int)None

Change the amount of oversampling bits.

Parameters

oversampleBits – the new value

setVoltage(voltage: float)None

Change the voltage.

Parameters

voltage – the new value