Skip to main content

Debounce

Emits a value only after a period of wait milliseconds with no events.

component image

In-ports

input <any> — input events to debounce.

config JSON (dynamic) — accepts a JSON object with configuration properties that can be set at runtime.

Out-ports

output <any> — debounced events.

Overview

The Debounce operator emits a value on the output port only after a configured period of wait milliseconds with no events on the input port.

If the trailing (default) setting is enabled, the operator emits a value on the trailing edge of the wait interval. If leading is enabled, the operator emits a value on the leading edge of the wait interval.

To reset the wait timer, send a RESET signal.

Example 1

The following diagram demonstrates the Debounce operator with a wait period set to 1000 milliseconds.

debounce example 1

Example 2

The same example as above, but with a RESET signal sent at 2200 ms.

debounce example 2

Settings

Enable realtime config port

If this setting is enabled, the component can be configured through the config port. This port accepts a configuration object as input and allows you to set dynamic properties at runtime. Note that using this port does not cause the component to reinitialize, but it may cause some previous state of the component to be lost.

Wait (wait)

Wait period in milliseconds.

Type: Number
Constraint: >= 0
Required: Yes

Leading (leading)

If enabled, the operator will emit a value on the leading edge of the wait interval.

Type: Boolean
Default: false
Required: No

Trailing (trailing)

If enabled, the operator will emit a value on the trailing edge of the wait interval.

Type: Boolean
Default: true
Required: No