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:
| Section | When it runs | Purpose |
|---|---|---|
| Setup | Once, when the program starts | Initialize hardware, set starting values |
| Loop | Continuously, ~1 kHz | Core 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
| Limit | Value |
|---|---|
| Max variables | 32 |
| Max operations per loop iteration | 512 |
| 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.