# Level to pulse
Converts a boolean level signal into a pulse. Generates a timed output pulse every time the input is true, even if it was already true. Useful for connecting stateful boolean outputs to pulse-triggered inputs.
Level to pulse
I
O
# Inputs
| ID | Abbrev | Name | Type | Default | Description |
|---|---|---|---|---|---|
input | I | Input | BOOLEAN | false | Boolean signal. Every true value triggers an output pulse, regardless of the previous state. |
# Outputs
| ID | Abbrev | Name | Type | Default | Description |
|---|---|---|---|---|---|
output | O | Output | BOOLEAN | false | Pulse output. Goes high for the configured pulse duration each time the input is true. |
# Configuration
| ID | Name | Type | Default | Unit | Description |
|---|---|---|---|---|---|
pulse_duration | Pulse duration | NUMBER | 0.1 | s | Duration of the output pulse. Details: > 0 |
# Source Code
View Volang source
value = input::value()
extern fn onPulseEnd() {
output::set("output", false)
}
if (value) {
callback::clear()
output::set("output", true)
pulse_ms = math::round(config::get("pulse_duration") * 1000)
callback::set(pulse_ms, "onPulseEnd")
}
