Skip to main content

Script Execution

Studio programs are compiled by the app and uploaded to the device, where they run as firmware code. The app handles compilation and upload automatically — you do not need to manage any low-level details.

Setup and Loop​

Every program has two sections:

SectionWhen it runsPurpose
SetupOnce, when the program startsInitialize hardware, set starting values
LoopContinuously, ~1 kHzCore program logic, runs every ~1 ms

Variables​

Programs can use up to 32 variables. Variables retain their values between loop iterations, so you can track state across time (counters, accumulation, timers, etc.).

Script Limits​

LimitValue
Max variables32
Max operations per loop iteration512
Loop period~1 ms (~1 kHz)

If a loop iteration exceeds 512 operations, the program stops automatically.

Error Handling​

If the program encounters a problem — such as a division by zero or exceeding the 512-operation budget — it stops automatically and all 64 event flags are cleared. An error message appears in the Serial Terminal panel.

See Script Lifecycle for details on uploading, running, and stopping programs.