Documentation / Hardware

Automations

Things that happen without a finger: timers, edges, thresholds and variable changes.

An automation is an event raised by the hardware or by time rather than by a finger on the screen. It has a trigger and a list of actions, exactly like a widget event, and it is evaluated inside app_poll() on every refresh. Automations live on the Data tab under the variables.

Two automations under the variables: a periodic tick and a digital input edge, each with its action list.
Two automations under the variables: a periodic tick and a digital input edge, each with its action list.

Triggers

TriggerParametersNotes
On startupDelay (ms)Runs once, after the UI has been created.
Every intervalInterval (ms), Also run at startupA periodic tick, useful for refreshing readouts.
Digital input changesInput, EdgeDebounced in the generated poll loop. "Active" respects the input's active-low setting.
Digital input heldInput, Hold time (ms)Fires once per press, after the input has been active continuously for the hold time.
Analog crosses thresholdAnalog input, When it, Threshold, HysteresisCompared against the scaled value. Hysteresis stops it chattering around the threshold.
Variable changesVariable, Condition, ValueEvaluated after every variable refresh.

Actions

The same list a widget event offers - Change Screen, Set/Modify Flag, Set Property, Increment Slider, Play Animation, Call function and the rest - plus the four hardware actions:

An automation with no actions, or an action with a required field empty, is an error.

Patterns

Generated code

Each automation becomes a block in app_poll() that keeps whatever state it needs - the last timer tick, the previous input level and the time it went active, whether an analog value is currently above or below its threshold, the previous variable value - and calls the generated action sequence when its condition is met. Debounce and hysteresis are applied in the generated code, so a chattering input or a reading hovering at the threshold fires once.

In the preview

Automations are firmware-side and the preview does not run them; use the preview drawer to change the simulated inputs and watch the bindings, then trust the generated code for the timing. The Digital input changes and Analog crosses threshold logic is simple enough to read in app_logic.cpp if you want to check it.