Luau Bindings — led

The require("led") script API — the RGB(W) status LED string. On the CM5 the string is driven by Clicky: DeMon sends per-LED colour intent over UART2 and Clicky does the WS2812 timing (DeMon has no LED driver of its own). Every function is [antos]. Design & native core: antos_led.

local led = require("led")
led.fill(0, 0, 0); led.set(0, 0, 40, 0); led.show()   -- LED 0 green

The buffer is not displayed until led.show() — set as many LEDs as you like, then push once. Channels are 0–255, index 0-based.

Function Behaviour
led.set(i, r, g, b) Set LED i to an RGB colour (buffered).
led.setRGBW(i, r, g, b, w) Set an RGBW LED including the white channel (RGBW strips).
led.fill(r, g, b) Set every LED to one colour.
led.clear() All off (buffered).
led.show() Push the buffer to the string — nothing displays until this.
led.count() Number of LEDs.
led.ready() Driver up?

These are the status LEDs. The per-key keyboard RGB is Clicky's own; this string is what DeMon lights through it.

Important: The Ant64 family of home computers are at early design/prototype stage, everything you see here is subject to change.