AnalogTrigger

class wpilib.AnalogTrigger(*args, **kwargs)

Bases: wpilib.ErrorBase, wpilib.Sendable

Overloaded function.

  1. __init__(self: wpilib._wpilib.AnalogTrigger, channel: int) -> None

Constructor for an analog trigger given a channel number.

Parameters

channel – The channel number on the roboRIO to represent. 0-3 are on-board 4-7 are on the MXP port.

  1. __init__(self: wpilib._wpilib.AnalogTrigger, channel: wpilib._wpilib.AnalogInput) -> None

Construct an analog trigger given an analog input.

This should be used in the case of sharing an analog channel between the trigger and an analog input object.

Parameters

channel – The pointer to the existing AnalogInput object

  1. __init__(self: wpilib._wpilib.AnalogTrigger, dutyCycle: wpilib._wpilib.DutyCycle) -> None

Construct an analog trigger given a duty cycle input.

Parameters

channel – The pointer to the existing DutyCycle object

createOutput(self: wpilib.AnalogTrigger, type: wpilib.AnalogTriggerType)wpilib.AnalogTriggerOutput

Creates an AnalogTriggerOutput object.

Gets an output object that can be used for routing. Caller is responsible for deleting the AnalogTriggerOutput object.

Parameters

type – An enum of the type of output object to create.

Returns

A pointer to a new AnalogTriggerOutput object.

getInWindow(self: wpilib.AnalogTrigger) → bool

Return the InWindow output of the analog trigger.

True if the analog input is between the upper and lower limits.

Returns

True if the analog input is between the upper and lower limits.

getIndex(self: wpilib.AnalogTrigger) → int

Return the index of the analog trigger.

This is the FPGA index of this analog trigger instance.

Returns

The index of the analog trigger.

getTriggerState(self: wpilib.AnalogTrigger) → bool

Return the TriggerState output of the analog trigger.

True if above upper limit. False if below lower limit. If in Hysteresis, maintain previous state.

Returns

True if above upper limit. False if below lower limit. If in Hysteresis, maintain previous state.

initSendable(self: wpilib.AnalogTrigger, builder: wpilib.SendableBuilder) → None
setAveraged(self: wpilib.AnalogTrigger, useAveragedValue: bool) → None

Configure the analog trigger to use the averaged vs. raw values.

If the value is true, then the averaged value is selected for the analog trigger, otherwise the immediate value is used.

Parameters

useAveragedValue – If true, use the Averaged value, otherwise use the instantaneous reading

setFiltered(self: wpilib.AnalogTrigger, useFilteredValue: bool) → None

Configure the analog trigger to use a filtered value.

The analog trigger will operate with a 3 point average rejection filter. This is designed to help with 360 degree pot applications for the period where the pot crosses through zero.

Parameters

useFilteredValue – If true, use the 3 point rejection filter, otherwise use the unfiltered value

setLimitsDutyCycle(self: wpilib.AnalogTrigger, lower: float, upper: float) → None

Set the upper and lower duty cycle limits of the analog trigger.

The limits are given as floating point values between 0 and 1.

Parameters
  • lower – The lower limit of the trigger in percentage.

  • upper – The upper limit of the trigger in percentage.

setLimitsRaw(self: wpilib.AnalogTrigger, lower: int, upper: int) → None

Set the upper and lower limits of the analog trigger.

The limits are given in ADC codes. If oversampling is used, the units must be scaled appropriately.

Parameters
  • lower – The lower limit of the trigger in ADC codes (12-bit values).

  • upper – The upper limit of the trigger in ADC codes (12-bit values).

setLimitsVoltage(self: wpilib.AnalogTrigger, lower: float, upper: float) → None

Set the upper and lower limits of the analog trigger.

The limits are given as floating point voltage values.

Parameters
  • lower – The lower limit of the trigger in Volts.

  • upper – The upper limit of the trigger in Volts.