Skip to main content

Event Flags

The system has 64 one-shot event flags, numbered 1–64. A flag is either set (1) or cleared (0). Flags are the primary way to coordinate between Studio programs, spike detection, and external commands.

Flag Ranges​

RangeUsage
1–32Free — available to user programs, the Serial Terminal, and the NET command
33–64Spike-reserved — automatically set by spike detection: when channel N fires, flag 33+N is set
warning

Flags 33–64 are managed by spike detection. Avoid using them for user-defined events unless spike detection is disabled.

Flag Operations​

OperationDescription
SETRaise a flag (set it to 1)
PEEKRead the current value without changing it
TAKERead the value and clear it atomically. If two programs call TAKE simultaneously, exactly one of them receives the value 1 — the other gets 0.

Cross-Board Flags​

Flags can be forwarded to another connected device using the NET command. This lets a spike event on one board trigger an action on another. See Multi-Board Flag Coordination for details.