DigitalGlitchFilter

class wpilib.DigitalGlitchFilter

Bases: wpiutil._wpiutil.Sendable

Class to enable glitch filtering on a set of digital inputs.

This class will manage adding and removing digital inputs from a FPGA glitch filter. The filter lets the user configure the time that an input must remain high or low before it is classified as high or low.

add(*args, **kwargs)

Overloaded function.

  1. add(self: wpilib._wpilib.DigitalGlitchFilter, input: wpilib._wpilib.DigitalSource) -> None

Assigns the DigitalSource to this glitch filter.

Parameters

input – The DigitalSource to add.

  1. add(self: wpilib._wpilib.DigitalGlitchFilter, input: wpilib._wpilib.Encoder) -> None

Assigns the Encoder to this glitch filter.

Parameters

input – The Encoder to add.

  1. add(self: wpilib._wpilib.DigitalGlitchFilter, input: wpilib._wpilib.Counter) -> None

Assigns the Counter to this glitch filter.

Parameters

input – The Counter to add.

getPeriodCycles() int

Gets the number of cycles that the input must not change state for.

Returns

The number of cycles.

getPeriodNanoSeconds() int

Gets the number of nanoseconds that the input must not change state for.

Returns

The number of nanoseconds.

initSendable(builder: wpiutil._wpiutil.SendableBuilder) None
remove(*args, **kwargs)

Overloaded function.

  1. remove(self: wpilib._wpilib.DigitalGlitchFilter, input: wpilib._wpilib.DigitalSource) -> None

Removes a digital input from this filter.

Removes the DigitalSource from this glitch filter and re-assigns it to the default filter.

Parameters

input – The DigitalSource to remove.

  1. remove(self: wpilib._wpilib.DigitalGlitchFilter, input: wpilib._wpilib.Encoder) -> None

Removes an encoder from this filter.

Removes the Encoder from this glitch filter and re-assigns it to the default filter.

Parameters

input – The Encoder to remove.

  1. remove(self: wpilib._wpilib.DigitalGlitchFilter, input: wpilib._wpilib.Counter) -> None

Removes a counter from this filter.

Removes the Counter from this glitch filter and re-assigns it to the default filter.

Parameters

input – The Counter to remove.

setPeriodCycles(fpgaCycles: int) None

Sets the number of cycles that the input must not change state for.

Parameters

fpgaCycles – The number of FPGA cycles.

setPeriodNanoSeconds(nanoseconds: int) None

Sets the number of nanoseconds that the input must not change state for.

Parameters

nanoseconds – The number of nanoseconds.