Skip to content

feat(rgbled): drive the decorative LEDs by default, use firmware LED groups - #306

Draft
pfeerick wants to merge 1 commit into
EdgeTX:masterfrom
pfeerick:pfeerick/rgbled-bling-groups
Draft

pfeerick wants to merge 1 commit into
EdgeTX:masterfrom
pfeerick:pfeerick/rgbled-bling-groups

Conversation

@pfeerick

@pfeerick pfeerick commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

Companion to EdgeTX/edgetx#7864.

Summary

LED_STRIP_LENGTH counts the decorative ("bling") LEDs followed by the custom switch LEDs. A script can only set a custom switch LED while that switch is set to NONE. On the TX16S Mk3, GX15 and TX15, the pattern scripts therefore swept 26 LEDs instead of the 20 gimbal ring LEDs: the sweep paused on the hidden positions, and any unused custom switch joined in.

Pattern scripts (police, scl, scr, runner, the solid colours and the others, in both color and bw128x64) now start with:

-- Set to true to also drive the LEDs of custom switches that are set to NONE
local USE_FULL_STRIP = false

local NUM_LEDS = LED_STRIP_LENGTH
if not USE_FULL_STRIP and (BLING_LED_STRIP_LENGTH or 0) > 0 then
  NUM_LEDS = BLING_LED_STRIP_LENGTH
end
  • By default they drive the decorative LEDs only.
  • Opt-in: setting USE_FULL_STRIP = true also drives unused custom switch LEDs.
  • Fallback: they use the full strip on firmware without BLING_LED_STRIP_LENGTH, which is today's behaviour, and on radios with no decorative LEDs (GX12).

gimbal.lua takes the ring layout from getRGBLedInfo() when the firmware provides it, and keeps its own per-radio table for older firmware. Ring angles are now counted from the ring's first LED. That matches how the firmware describes a ring, and gives the same result for the existing table entries: I compared the LED output from both paths for TX15, TX16S Mk3, GX15 and ST16.

Files that were stored with CRLF line endings keep them.

Testing

  • Equivalence check: gimbal.lua was run in a Lua 5.3 harness with mocked radio functions. It produced identical LED output from the firmware groups and from its own table for TX15, TX16S Mk3, GX15 and ST16.
  • Hardware, TX16S Mk3: police.lua and gimbal.lua were tested with the firmware from feat(lua): describe the RGB LED layout to scripts, fix custom switch LED mapping edgetx#7864. police.lua was run with both the default and USE_FULL_STRIP = true. That firmware's getRGBLedInfo() ring layout was also verified on the same radio.
  • Syntax: all changed scripts pass a luac syntax check.

🤖 Generated with Claude Code

…groups

LED_STRIP_LENGTH also counts the custom switch LEDs, which scripts can
only set while that switch is set to NONE. On radios such as the
TX16S Mk3, GX15 and TX15 the pattern scripts therefore swept 26 LEDs
instead of the 20 gimbal ring LEDs, pausing on the hidden positions and
lighting any unused custom switch.

The pattern scripts now use BLING_LED_STRIP_LENGTH when the firmware
provides it, with a USE_FULL_STRIP option at the top of each script to
also drive unused custom switch LEDs. They fall back to the full strip
on older firmware and on radios with no decorative LEDs (GX12).

gimbal.lua takes the ring layout from getRGBLedInfo() when available,
and keeps its own table for older firmware. Ring angles are now counted
from the ring's first LED, which gives the same result for the existing
table entries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant