Debouncer

class Debouncer @JvmOverloads constructor(var debounceTimeSeconds: Double, var type: Debouncer.DebounceType = DebounceType.RISING)(source)

A simple debounce filter for boolean streams. Requires that the boolean change value from baseline for a specified period of time before the filtered value changes.

Parameters

debounceTimeSeconds

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.

Constructors

Link copied to clipboard
constructor(debounceTimeSeconds: Double, type: Debouncer.DebounceType = DebounceType.RISING)

Types

Link copied to clipboard

Type of debouncing to perform.

Properties

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun calculate(input: Boolean, timestamp: ComparableTimeMark = TimeSource.Monotonic.markNow()): Boolean

Applies the debouncer to the input stream.