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
| Range | Usage |
|---|---|
| 1–32 | Free — available to user programs, the Serial Terminal, and the NET command |
| 33–64 | Spike-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
| Operation | Description |
|---|---|
| SET | Raise a flag (set it to 1) |
| PEEK | Read the current value without changing it |
| TAKE | Read 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.