DigitalGlitchFilter

class wpilib.DigitalGlitchFilter[source]

Bases: wpilib.SensorBase

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(input)[source]

Assigns the DigitalSource, Encoder, or Counter to this glitch filter.

Parameters:input – The object to add
filterAllocated = [False, False, False]
free()[source]
getPeriodCycles()[source]

Gets the number of FPGA cycles that the input must hold steady to pass through this glitch filter.

Returns:The number of cycles.
getPeriodNanoSeconds()[source]

Gets the number of nanoseconds that the input must hold steady to pass through this glitch filter.

Returns:The number of nanoseconds.
mutex = <_thread.lock object>
remove(input)[source]

Removes this filter from the given input object

setPeriodCycles(fpga_cycles)[source]

Sets the number of FPGA cycles that the input must hold steady to pass through this glitch filter.

Parameters:fpga_cycles – The number of FPGA cycles.
setPeriodNanoSeconds(nanoseconds)[source]

Sets the number of nanoseconds that the input must hold steady to pass through this glitch filter.

Parameters:nanoseconds – The number of nanoseconds.