Motion Data
Ember listens for ESP-NOW motion broadcasts (0.0–1.0). The sender must use the same Wi-Fi channel as Ember — check the serial log for espnow: listening on channel N. When connected to home Wi-Fi, the channel is set by your router (not channel 1).
Motion Patterns
Language Reference
Ember patterns run once per pixel per frame. Set the output with hsv(h,s,v) or rgb(r,g,b) at the end.
Built-in variables
i / index — pixel index
n / pixelCount — strip length
t / time — seconds since boot
PI, TAU
Conditionals
if (cond) stmt; — run stmt when cond is non-zero
if (cond) a; else b; — optional else branch
a ? b : c — ternary expression
Functions
time(s) — sawtooth 0→1 every s seconds
wave(v) — 0→1 sine of v cycles
triangle(v) — 0→1→0 triangle
square(v, duty) — square wave, duty defaults to 0.5
perlin1D(x), perlin2D(x,y) — organic noise
hash(x) — stable per-pixel random
sin cos abs sqrt pow floor ceil round frac
min max clamp mix step smoothstep
Audio (when a mic is configured)
vu() — overall level 0→1
peak() — slow-decay peak
pitch() — dominant frequency, 0=low … 1=high
beat() — 1 on attack, decays fast
band(n) — band n (0..7), low→high
bass(), mid(), treble() — band shortcuts
motion() / motion — ESP-NOW motion intensity 0→1