Package edu.wpi.first.math.filter
Class Debouncer
- java.lang.Object
-
- edu.wpi.first.math.filter.Debouncer
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Debouncer.DebounceType
-
Constructor Summary
Constructors Constructor Description Debouncer(double debounceTime)
Creates a new Debouncer.Debouncer(double debounceTime, Debouncer.DebounceType type)
Creates a new Debouncer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
calculate(boolean input)
Applies the debouncer to the input stream.
-
-
-
Constructor Detail
-
Debouncer
public Debouncer(double debounceTime, Debouncer.DebounceType type)
Creates a new Debouncer.- Parameters:
debounceTime
- The number of seconds the value must change from baseline for the filtered value to change.type
- Which type of state change the debouncing will be performed on.
-
Debouncer
public Debouncer(double debounceTime)
Creates a new Debouncer. Baseline value defaulted to "false."- Parameters:
debounceTime
- The number of seconds the value must change from baseline for the filtered value to change.
-
-
Method Detail
-
calculate
public boolean calculate(boolean input)
Applies the debouncer to the input stream.- Parameters:
input
- The current value of the input stream.- Returns:
- The debounced value of the input stream.
-
-