OUTPUT
LED 0#000000
LED 1#000000
LED 2#000000
LED 3#000000
MACHINE STATE
FRAME0
TIME0.000 s
LOOP0
SELECTION{}
PENDING0
LED REGISTERS
DISASSEMBLY
TRACE
TIMELINE click to seek, shift+click to toggle a breakpoint
FRAME 0
FRAME 0
IMPORT
REPORT
Nothing imported yet.
LOAD ON THE BADGE
SIZE0 bytes
FRAMES0
DURATION0.00 s
C SOURCE
PROJECT FILE
Studio JSON keeps the editor structure, name and fps. Re-import it from the IMPORT view.
HOW IT WORKS
A sequence is a list of frame blocks. Each block runs at one specific frame,
top to bottom, and gives commands to the LEDs. The frame counter advances at the
badge fps setting, so at 30 fps a 150 frame sequence lasts 5 seconds.
- Every block starts with an empty selection. A SELECT in an earlier block does not carry over.
- SELECT adds LEDs to the selection. RESET SELECTION empties it again inside the same block.
- A color command applies to every currently selected LED, and owns that LED for its LENGTH in frames.
- A command keeps running after its own block ends, until it expires or another command overwrites that LED.
- An LED with no live command is black.
- When the sequence restarts, every LED and the selection are cleared.
INSTRUCTION REFERENCE
| MACRO | ARGUMENTS | BYTES | MEANING |
|---|
Sizes include the opcode byte. LED_SELECT costs 2 bytes per LED. A frame block costs 3 bytes on top of its instructions (2 for the start frame, 1 for the end marker). The sequence header costs 2 bytes.
RANGES AND GOTCHAS
- Frame counts, start frames and lengths are 16 bit: 0 to 65535.
- R, G, B are 0 to 255. Blink PERIOD is a single byte, 0 to 255.
- H is 0 to 359. S and V are 0 to 100.
- HSV is stored pre-scaled, and the macro truncates:
(int)(100 * 2.55)is 254, not 255, because 2.55 has no exact binary form. S=100 and V=100 therefore land one step below full. This studio reproduces the truncation exactly, so the preview matches the badge. - Only 101 of the 256 storable S/V byte values are reachable from an integer input, so importing hex that was not produced by these macros may round.
- An unterminated frame block makes the badge reject the whole sequence and
fall back to the red blink from
examples/error.c.
KEYBOARD
space | Play / pause |
left / right | Step one frame |
shift + left / right | Step ten frames |
home | Back to frame 0 |
ctrl + z | Undo |
ctrl + shift + z | Redo |
1 - 5 | Switch view |