Skip to content

Add effect development guide - #4

Closed
aphelps-claude-bot wants to merge 5 commits into
masterfrom
new-effect-guide
Closed

aphelps-claude-bot wants to merge 5 commits into
masterfrom
new-effect-guide

Conversation

@aphelps-claude-bot

Copy link
Copy Markdown
Collaborator

Summary

Adds docs/effect-development-guide.md — a human-readable reference for
developing new LED effects in the AMPWorks usermod.

Covers:

  • Effect anatomy (function, PROGMEM descriptor, registration)
  • Full descriptor format syntax with examples from this repo
  • Segment API: setPixelColor, fill, fade_out, blur, blendPixelColor
  • Color utilities: color_from_palette, color_wheel, color_blend, map8
  • Frame timing and the cycle-tick pattern
  • SEGENV persistent state fields (call, step, aux0/1)
  • SEGENV.data scratch memory with allocateData example
  • Audio-reactive effects via um_data
  • MPR121 touch-reactive effects
  • Where to find more: FX.cpp, FX.h, wled.h, existing ampworks effects

Test plan

  • Read through the guide for accuracy against the actual code
  • Verify all code snippets compile (cross-check against ampworks.cpp)

🤖 Generated with Claude Code

aphelps and others added 5 commits April 17, 2026 16:23
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
docs/effect-development-guide.md covers effect anatomy, PROGMEM descriptor
format, Segment API, frame timing, SEGENV state, scratch memory, audio and
MPR121 touch reactivity, and pointers to deeper reading in the codebase.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
## 1. Overview

WLED effects are C++ functions called every frame (~16 ms) that write colors
to a segment of LEDs. Custom effects in this repo live in `ampworks.cpp` and

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This guide should not be particular to my environment, so should not use "ampworks.cpp". Remove those references, and add both instructions for adding the effects to WLED's main effects list (in FX.cpp) or by adding a usermod and putting them there.

@aphelps
aphelps deleted the branch master April 18, 2026 17:58
@aphelps aphelps closed this Apr 18, 2026
aphelps added a commit that referenced this pull request Apr 18, 2026
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
aphelps-claude-bot added a commit that referenced this pull request Aug 29, 2026
* Bump esp-now-router 07c264f -> 04d0ad2 (three merges behind)

The superproject recorded 07c264f2, so `make test-router` and CI were exercising
sources from before #4. Three merges were missing:

  #4  the WLED coordinator (onboard/drive devices from firmware)
  #5  coordinator mode gate + blacklist a target that fails a hop
  #6  start ESP-NOW after the STA associates

#6 in particular is not optional for anyone building from this repo: without it
the router pins the boot ESP-NOW channel, the TX confirm callback stops
arriving, and 100% of adverts fail — so a WLED_dev pinned before it records a
backbone that cannot form.

Verified rather than assumed: `make test-router` at the new pointer runs and
passes the coordinator-era suites (test_coord_mode, test_coord_phase,
test_coord_boot, test_onboard_cfg, test_candidate, test_hmtl_to_wled), none of
which exist at 07c264f2. That is the evidence the newer sources are being built,
rather than a green tick from the old ones.

This is the fifth time work has landed where nothing pointed at it. The durable
fix — CI failing when a submodule's origin/main is ahead of the recorded pointer
— is still unbuilt and would have caught every instance.

Known follow-up: esp-now-router#7 registers test_espnow_start in that repo's
SUITES list; it is absent at this pointer, so `make test-router` will not run it
until #7 merges and the pointer moves again.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01F4oTr1YW3z7ozksMUT1z5j

* Re-point to 847f30c so the bump carries #7 as well

esp-now-router#7 merged after this branch was opened, which would have left the
pointer one commit stale the moment #42 landed — the exact recurring miss this
PR exists to fix, reproduced inside the fix for it.

847f30c registers test_espnow_start in the router's SUITES list. Verified from
the superproject: `make test-router` at this pointer now NAMES
test_espnow_start/test_espnow_start and passes it. At 04d0ad2 it did not run at
all, so the previous pointer would have carried #6's code without #6's test.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01F4oTr1YW3z7ozksMUT1z5j

---------

Co-authored-by: aphelps-claude-bot <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
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.

2 participants