Studio Overview
The Studio is the visual programming environment in the HMCLS app. Build programs by dragging blocks onto a canvas — no low-level code required.
Two-Segment Model
Every program has exactly two sections:
SETUP
Acquisition
acquisition start
Variables
declare variablenamecounterinitial0
LOOP ~1 kHz
Variables
add (+)counter+1
Control
ifcounter>=1000
Variables
set to numbercounter=0
IO
LED toggleLED1 (green)
| Section | Runs | Purpose |
|---|---|---|
| Setup | Once, at script start | Initialize hardware, declare variables |
| Loop | Repeatedly, ~1 kHz | Core logic that executes every ~1 ms |
Variables declared in Setup persist across loop iterations — their values are never reset when the loop restarts.
Interface Layout
- Block palette — left panel; browse and drag blocks grouped by category
- Canvas — centre; Setup area at top, Loop area below
- Compile button — converts block graph → compact binary program
- Upload button — sends the program to the device over the network
Palette Groups
| Group | Contents |
|---|---|
| Variables | Declare, assign, and compute on integer variables |
| Control | If/else, if flag, repeat, wait, end iteration |
| Acquisition | Start/stop acquisition, read RMS, spike events, elapsed time |
| I2C | Read and write to external I2C devices |
| IO | LED control |
| Debug | Log messages and variable values to the Serial Terminal |
| Network | Set/test event flags, send commands to other boards |
| Headstage | Configure signal chain (bandwidths, mode, spike detection) |
Compile & Upload Workflow
- Build your program on the canvas.
- Click Compile — any errors (undeclared variables, invalid configs) are highlighted inline.
- Click Upload — the app stops the running script, transfers the new program, and starts it.
- The device begins execution immediately.
tip
The op budget shows compiled program size. Stay under 512 operations in the Loop section.