← All exercises

Long Press

medium

Fires a single-scan pulse when the input is released after being held continuously for at least 2 seconds.

What it teaches

Combines a hold-time timer with falling-edge detection on the input, gated by whether the timer reached preset before release. The action fires on release only when the hold qualified — the canonical mobile/UI long-press semantic. Teaches edge detection, timer threshold gating, and conditional event-on-release logic.

Inputs and outputs

TagTypeDefaultDescription
In_ButtonBOOLPush button input
Out_PulseBOOLHigh for one scan when button is released after a long press

Required behavior