-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
User fx documentation #4724
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
User fx documentation #4724
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Nitpick comments (9)
usermods/user_fx/library.json (1)
1-3: Consider adding standard library metadata fieldsWhile the JSON is valid, typical Arduino/PlatformIO library.json files include additional metadata for better discoverability and integration. Consider adding fields like
version,description,keywords,authors, andrepository.{ - "name": "user_fx" + "name": "user_fx", + "version": "1.0.0", + "description": "Custom LED effects usermod for WLED", + "keywords": "wled, led, effects, usermod, fire", + "authors": { + "name": "danewhero" + }, + "repository": { + "type": "git", + "url": "https://github.com/Aircoookie/WLED.git" + } }usermods/user_fx/README.md (4)
44-45: Complete the TODO section for static effect definitionThis section has an incomplete TODO that should be addressed before merging.
Would you like me to help complete this section with an example of using the static effect as a fallback pattern?
239-240: Complete the metadata string documentationThe metadata string explanation is marked as TODO and needs to be completed. This is important documentation for users to understand how to configure their effects properly.
Would you like me to help document the metadata string format based on WLED's documentation?
291-292: Add content for 1D effects sectionThe 1D effects section is marked as TODO. Since the PR objectives mention that the author wants a better example than the "Police" effect, this section needs attention.
Would you like me to help create a comprehensive 1D effect example and documentation?
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
291-291: Emphasis used instead of a heading
null(MD036, no-emphasis-as-heading)
295-301: Update the Police effect integration instructionsThe guide mentions copying code from an old commit, but doesn't provide the actual implementation. Since this is meant to be a complete example, consider including the Police effect code directly or providing clearer integration steps.
usermods/user_fx/user_fx.cpp (4)
43-48: Consider bounds checking in scroll operationWhile the loop bounds appear correct, it's good practice to ensure that the XY lambda doesn't produce out-of-bounds indices, especially if the segment dimensions can change dynamically.
Consider adding bounds validation or using WLED's built-in safe pixel access methods if available.
30-30: Add clarity to the comment about data allocationThe comment could be more specific about what data is being stored.
- unsigned dataSize = SEGMENT.length(); // allocate persistent data for heat value for each pixel + unsigned dataSize = SEGMENT.length(); // allocate persistent data for heat value (1 byte per pixel)
71-71: Consider integer overflow protectionThe calculation
v * 100could potentially overflow ifvapproaches its maximum value. While unlikely in this specific case due to the diffusion logic, it's worth considering.- tmp_row[x] = min(255, (int)(v * 100 / (300 + diffusion))); + tmp_row[x] = min(255, (int)((uint32_t)v * 100 / (300 + diffusion)));
77-77: Consider using WLED's recommended color functionsBased on the README documentation,
SEGMENT.color_from_palette()should be favored overColorFromPalette().- uint32_t color = ColorFromPalette(SEGPALETTE, tmp_row[x], 255, LINEARBLEND_NOWRAP); + uint32_t color = SEGMENT.color_from_palette(tmp_row[x], false, false, 255);
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
usermods/user_fx/README.md(1 hunks)usermods/user_fx/library.json(1 hunks)usermods/user_fx/user_fx.cpp(1 hunks)
🧰 Additional context used
🪛 LanguageTool
usermods/user_fx/README.md
[style] ~13-~13: Consider removing “of” to be more concise
Context: ...area is where you place the FX code for all of the custom effects you want to use. This m...
(ALL_OF_THE)
[style] ~15-~15: As a shorter alternative for ‘able to’, consider using “can”.
Context: ...mods have to be registered so that they are able to be compiled into your binary. We will ...
(BE_ABLE_TO)
[style] ~15-~15: Avoid the passive voice after ‘to be able to’.
Context: ... be registered so that they are able to be compiled into your binary. We will go into grea...
(ABLE_TO_PASSIVE)
[typographical] ~32-~32: It appears that a comma is missing.
Context: ... Understanding 2D WLED Effects In this section we give some advice to those who are ne...
(DURING_THAT_TIME_COMMA)
[uncategorized] ~36-~36: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...le. This file handles all other imports and it has all the global variable declarat...
(COMMA_COMPOUND_SENTENCE)
[uncategorized] ~53-~53: Possible missing comma found.
Context: ...lock contains several constant variable definitions which essentially serve to extract the ...
(AI_HYDRA_LEO_MISSING_COMMA)
[misspelling] ~74-~74: Nonstandard phrase. Did you mean: “from 0 to 255”?
Context: ...MENT.speed (user-controllable parameter from 0–255) to a value between 20 and 80 Hz. * T...
(FROM_X_Y)
[uncategorized] ~76-~76: Possible missing comma found.
Context: ...gher speed = more frames per second). * Next we convert refresh rate from Hz to mill...
(AI_HYDRA_LEO_MISSING_COMMA)
[uncategorized] ~80-~80: Possible missing comma found.
Context: ...re diffusion = smoother flame spread. * Next we assign SEGMENT.intensity (user inp...
(AI_HYDRA_LEO_MISSING_COMMA)
[uncategorized] ~149-~149: Possible missing preposition found.
Context: ...whether we even attempt to spawn sparks this frame. * hw_random8() gives another...
(AI_HYDRA_LEO_MISSING_IN)
[uncategorized] ~180-~180: Possible missing article found.
Context: ...Starting with the current heat value of pixel (x, y) assigned v: * if there’s a p...
(AI_HYDRA_LEO_MISSING_A)
[uncategorized] ~205-~205: Possible missing comma found.
Context: ... color-rendering for each pixel row.) * Next we update the main segment data with th...
(AI_HYDRA_LEO_MISSING_COMMA)
[grammar] ~207-~207: Use the plural noun “” with the number ‘255’.
Context: ...olor` from the current palette with 255 brightness, and no wrapping in palette lookup. *...
(IN_CD_PUNCTUATION)
[typographical] ~209-~209: Consider adding a comma after ‘Finally’ for more clarity.
Context: ... flames (e.g., yellow → red → black). * Finally we set the rendered color for the pixel...
(RB_LY_COMMA)
[grammar] ~211-~211: The word “fallback” is a noun. The verb is spelled with a space.
Context: ...h row. * If palette use is disabled, we fallback to fading a base color. * SEGCOLOR(0)...
(NOUN_VERB_CONFUSION)
[grammar] ~231-~231: Did you mean the adverb/preposition “within”?
Context: ...ines how the effect is to be interacted with in the UI: ``` static const char data_FX...
(WITH_IN)
[uncategorized] ~270-~270: Possible missing comma found.
Context: ...important one that registers the custom effect so WLED knows about it. * 255: Tempor...
(AI_HYDRA_LEO_MISSING_COMMA)
[uncategorized] ~273-~273: Loose punctuation mark.
Context: ...ction. * _data_FX_MODE_DIFFUSIONFIRE: Metadata string stored in PROGMEM, desc...
(UNLIKELY_OPENING_PUNCTUATION)
🪛 markdownlint-cli2 (0.17.2)
usermods/user_fx/README.md
38-38: Fenced code blocks should have a language specified
null
(MD040, fenced-code-language)
49-49: Fenced code blocks should have a language specified
null
(MD040, fenced-code-language)
54-54: Fenced code blocks should have a language specified
null
(MD040, fenced-code-language)
67-67: Fenced code blocks should have a language specified
null
(MD040, fenced-code-language)
88-88: Fenced code blocks should have a language specified
null
(MD040, fenced-code-language)
95-95: Fenced code blocks should have a language specified
null
(MD040, fenced-code-language)
106-106: Fenced code blocks should have a language specified
null
(MD040, fenced-code-language)
118-118: Fenced code blocks should have a language specified
null
(MD040, fenced-code-language)
137-137: Fenced code blocks should have a language specified
null
(MD040, fenced-code-language)
164-164: Fenced code blocks should have a language specified
null
(MD040, fenced-code-language)
191-191: Fenced code blocks should have a language specified
null
(MD040, fenced-code-language)
216-216: Fenced code blocks should have a language specified
null
(MD040, fenced-code-language)
232-232: Fenced code blocks should have a language specified
null
(MD040, fenced-code-language)
244-244: Fenced code blocks should have a language specified
null
(MD040, fenced-code-language)
281-281: Fenced code blocks should have a language specified
null
(MD040, fenced-code-language)
291-291: Emphasis used instead of a heading
null
(MD036, no-emphasis-as-heading)
🔇 Additional comments (2)
usermods/user_fx/user_fx.cpp (2)
88-88: Well-structured metadata stringThe metadata string properly defines the effect name, controls, and default palette. Good job following WLED's metadata format!
15-87: Well-implemented fire effect with proper WLED integrationThe diffusion fire effect is well-structured with:
- Proper 2D validation
- Efficient memory usage
- Configurable parameters mapped to UI controls
- Smooth animation with timing control
The implementation follows WLED best practices.
|
@DedeHai any feedback for what I have in the README so far? |
usermods/user_fx/README.md
Outdated
|
|
||
| ## Basic Syntax for WLED Effect Creation | ||
| Below are some helpful variables and functions to know as you start your journey towards WLED effect creation: | ||
| * **SEGMENT.intensity / speed / custom1 etc.** -> This syntax helps define the UI sliders that can make certain elements of your running code editable by the user. (These can be controlled by the API as well.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume this is unfinished.
I would make a list or even a table, with variable names, type or size (8bit, 16bit), purpose or usage example
usermods/user_fx/README.md
Outdated
| * **SEGMENT.intensity / speed / custom1 etc.** -> This syntax helps define the UI sliders that can make certain elements of your running code editable by the user. (These can be controlled by the API as well.) | ||
| * **SEGENV.call / step / aux0 / aux1** - these are useful counters for you to use in your code. | ||
| * **SEGLEN / SEG_W / SEG_H** -> These variables are macros that help define the length and width of your LED strip/matrix segment. They can be changed at any time if the user sets new segment size(s). | ||
| * **SEGCOLOR(x) / SEGPALETTE** for user colors from UI (and how it relates to meta string) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
segpalette is only used in conjunction with ColorFromPalette but as mentioned below, SEGMENT.color_from_palette() should be used in general. you can also explain the difference between the two (one uses SEGCOLOR if palette is set to 0 = default palette)
usermods/user_fx/README.md
Outdated
| * Next, we assign the number of rows (height) in the segment to rows. | ||
| * SEG_H is a macro for SEGMENT.height(). Combined with cols, this allows pixel addressing in 2D (x, y) space. | ||
| * The third line declares a lambda function named XY to convert (x, y) matrix coordinates into a 1D index in the LED array. This assumes row-major order (left to right, top to bottom). | ||
| * WLED internally treats the LED strip as a 1D array, so effects must translate 2D coordinates into 1D indices. This lambda helps with that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is partially incorrect. effects do not need to translate to 2D using XY(), there are 2D functions to set pixel colors that take care of it. XY is only needed in special cases or - like in the example - to map a local 1D array to 2D.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed "WLED internally treats the LED strip as a 1D array, so effects must translate 2D coordinates into 1D indices. This lambda helps with that" to just be "This lambda helps with mapping a local 1D array to a 2D one." would you agree with this?
|
please pull latest changes of main into this PR as an introduction, a quick overview of how an FX is generally structured and rendered may be helpful.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
usermods/user_fx/README.md (2)
3-3: Fix spelling/grammar in the opening paragraphSmall polish goes a long way for first-impressions. Consider:
-This Usermod is a common place to put various user's private LED Effects. It gives you a way to load in your own custom WLED effects, or to load in depracated WLED effects that you want to bring back--all without having to mess with the core WLED source code. +This usermod is a common place to put various users' private LED effects. It lets you load your own custom WLED effects, or resurrect deprecated WLED effects, without touching the core WLED source code.
17-18: Typo: “abour” → “about”-We will go into greater detail on how custom effects work in the usermod and how to go abour creating your own in the section below. +We will go into greater detail on how custom effects work in the usermod and how to go about creating your own in the section below.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
usermods/user_fx/README.md(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: willmmiles
PR: wled/WLED#4623
File: usermods/word-clock-matrix/word-clock-matrix.cpp:332-332
Timestamp: 2025-03-29T01:22:54.617Z
Learning: In the WLED project, hardcoded usermod IDs (like 500 in the WordClockMatrix's getId() method) are intentionally used as part of a strategy to avoid modifying core code. There are plans to remove numeric usermod IDs entirely in the future.
Learnt from: netmindz
PR: wled/WLED#4728
File: wled00/FX.h:378-378
Timestamp: 2025-06-15T09:59:52.720Z
Learning: In WLED's FX.h, MODE_COUNT represents the highest FX_MODE_ ID + 1, not the total count of FX_MODE_ definitions. This is because some effects may have been removed but their IDs are not reused, creating gaps in the numbering sequence. MODE_COUNT is used for array bounds and range checking.
Learnt from: netmindz
PR: wled/WLED#4728
File: wled00/FX.h:378-378
Timestamp: 2025-06-15T09:59:52.720Z
Learning: In WLED's FX.h, MODE_COUNT represents the highest FX_MODE_ ID + 1, not the total count of FX_MODE_ definitions. This is because some effects may have been removed but their IDs are not reused, creating gaps in the numbering sequence. MODE_COUNT is used for array bounds and range checking.
Learnt from: KrX3D
PR: wled/WLED#4237
File: usermods/INA219_v2/INA219_v2.cpp:265-276
Timestamp: 2025-04-18T22:27:58.634Z
Learning: When implementing MQTT message handling in WLED usermods, use `strstr(topic, "/specific/path")` instead of `strcmp_P(topic, PSTR("/specific/path"))` to properly match topics that include the device prefix. The full MQTT topic typically follows the pattern `<mqttDeviceTopic>/specific/path`.
Learnt from: DedeHai
PR: wled/WLED#4750
File: usermods/audioreactive/audio_reactive.cpp:311-321
Timestamp: 2025-06-27T06:04:44.622Z
Learning: In WLED's AudioReactive usermod, FFT buffer memory (valFFT, windowFFT) is allocated once during initialization and never deallocated, following typical embedded system design where core functionality buffers persist for the application lifetime. Raw buffer pointers for aligned allocations don't need to be tracked in the current implementation since deallocation is never performed.
usermods/user_fx/README.md (5)
Learnt from: netmindz
PR: wled/WLED#4728
File: wled00/FX.h:378-378
Timestamp: 2025-06-15T09:59:52.720Z
Learning: In WLED's FX.h, MODE_COUNT represents the highest FX_MODE_ ID + 1, not the total count of FX_MODE_ definitions. This is because some effects may have been removed but their IDs are not reused, creating gaps in the numbering sequence. MODE_COUNT is used for array bounds and range checking.
Learnt from: netmindz
PR: wled/WLED#4728
File: wled00/FX.h:378-378
Timestamp: 2025-06-15T09:59:52.720Z
Learning: In WLED's FX.h, MODE_COUNT represents the highest FX_MODE_ ID + 1, not the total count of FX_MODE_ definitions. This is because some effects may have been removed but their IDs are not reused, creating gaps in the numbering sequence. MODE_COUNT is used for array bounds and range checking.
Learnt from: willmmiles
PR: wled/WLED#4623
File: usermods/word-clock-matrix/word-clock-matrix.cpp:332-332
Timestamp: 2025-03-29T01:22:54.617Z
Learning: In the WLED project, hardcoded usermod IDs (like 500 in the WordClockMatrix's getId() method) are intentionally used as part of a strategy to avoid modifying core code. There are plans to remove numeric usermod IDs entirely in the future.
Learnt from: KrX3D
PR: wled/WLED#4237
File: usermods/INA219_v2/INA219_v2.cpp:265-276
Timestamp: 2025-04-18T22:27:58.634Z
Learning: When implementing MQTT message handling in WLED usermods, use `strstr(topic, "/specific/path")` instead of `strcmp_P(topic, PSTR("/specific/path"))` to properly match topics that include the device prefix. The full MQTT topic typically follows the pattern `<mqttDeviceTopic>/specific/path`.
Learnt from: DedeHai
PR: wled/WLED#4682
File: wled00/FX.cpp:9016-9039
Timestamp: 2025-05-09T18:48:21.296Z
Learning: WLED does not support matrices large enough (≥1024 px) for 32-bit overflow in dx*dx + dy*dy to be a practical concern in particle system effects.
🪛 LanguageTool
usermods/user_fx/README.md
[uncategorized] ~3-~3: The grammatical number of this noun doesn’t look right. Consider replacing it.
Context: ...sermod is a common place to put various user's private LED Effects. It gives you a ...
(AI_EN_LECTOR_REPLACEMENT_NOUN_NUMBER)
[style] ~13-~13: Consider removing “of” to be more concise
Context: ...area is where you place the FX code for all of the custom effects you want to use. This m...
(ALL_OF_THE)
[style] ~15-~15: As a shorter alternative for ‘able to’, consider using “can”.
Context: ...mods have to be registered so that they are able to be compiled into your binary. We will ...
(BE_ABLE_TO)
[style] ~15-~15: Avoid the passive voice after ‘to be able to’.
Context: ... be registered so that they are able to be compiled into your binary. We will go into grea...
(ABLE_TO_PASSIVE)
[uncategorized] ~24-~24: You might be missing the article “a” here.
Context: ...be changed at any time if the user sets new segment size(s). * **SEGCOLOR(x) / SEGP...
(AI_EN_LECTOR_MISSING_DETERMINER_A)
[typographical] ~32-~32: It appears that a comma is missing.
Context: ... Understanding 2D WLED Effects In this section we give some advice to those who are ne...
(DURING_THAT_TIME_COMMA)
[uncategorized] ~36-~36: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...le. This file handles all other imports and it has all the global variable declarat...
(COMMA_COMPOUND_SENTENCE)
[uncategorized] ~53-~53: Possible missing comma found.
Context: ...lock contains several constant variable definitions which essentially serve to extract the ...
(AI_HYDRA_LEO_MISSING_COMMA)
[misspelling] ~74-~74: Nonstandard phrase. Did you mean: “from 0 to 255”?
Context: ...MENT.speed (user-controllable parameter from 0–255) to a value between 20 and 80 Hz. * T...
(FROM_X_Y)
[uncategorized] ~76-~76: Possible missing comma found.
Context: ...gher speed = more frames per second). * Next we convert refresh rate from Hz to mill...
(AI_HYDRA_LEO_MISSING_COMMA)
[uncategorized] ~76-~76: You might be missing the article “the” here.
Context: ...e frames per second). * Next we convert refresh rate from Hz to milliseconds. (It’s eas...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[uncategorized] ~80-~80: Possible missing comma found.
Context: ...re diffusion = smoother flame spread. * Next we assign SEGMENT.intensity (user inp...
(AI_HYDRA_LEO_MISSING_COMMA)
[uncategorized] ~102-~102: You might be missing the article “the” here.
Context: ...nd the effect can’t proceed. * It calls previously defined mode_static() fallback effect...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[uncategorized] ~131-~131: The preposition “of” seems more likely in this position.
Context: ...conditional statement in the first line fo code ensures the effect updates on a fi...
(AI_EN_LECTOR_REPLACEMENT_PREPOSITION)
[uncategorized] ~149-~149: Possible missing preposition found.
Context: ...whether we even attempt to spawn sparks this frame. * hw_random8() gives another...
(AI_HYDRA_LEO_MISSING_IN)
[uncategorized] ~180-~180: Possible missing article found.
Context: ...Starting with the current heat value of pixel (x, y) assigned v: * if there’s a p...
(AI_HYDRA_LEO_MISSING_A)
[uncategorized] ~205-~205: Possible missing comma found.
Context: ... color-rendering for each pixel row.) * Next we update the main segment data with th...
(AI_HYDRA_LEO_MISSING_COMMA)
[grammar] ~207-~207: Use the plural noun “” with the number ‘255’.
Context: ...olor` from the current palette with 255 brightness, and no wrapping in palette lookup. *...
(IN_CD_PUNCTUATION)
[typographical] ~209-~209: Consider adding a comma after ‘Finally’ for more clarity.
Context: ... flames (e.g., yellow → red → black). * Finally we set the rendered color for the pixel...
(RB_LY_COMMA)
[grammar] ~211-~211: The word “fallback” is a noun. The verb is spelled with a space.
Context: ...h row. * If palette use is disabled, we fallback to fading a base color. * SEGCOLOR(0)...
(NOUN_VERB_CONFUSION)
[grammar] ~231-~231: Did you mean the adverb/preposition “within”?
Context: ...ines how the effect is to be interacted with in the UI: ```cpp static const char data...
(WITH_IN)
[uncategorized] ~270-~270: Possible missing comma found.
Context: ...important one that registers the custom effect so WLED knows about it. * 255: Tempor...
(AI_HYDRA_LEO_MISSING_COMMA)
[uncategorized] ~273-~273: Loose punctuation mark.
Context: ...ction. * _data_FX_MODE_DIFFUSIONFIRE: Metadata string stored in PROGMEM, desc...
(UNLIKELY_OPENING_PUNCTUATION)
🪛 markdownlint-cli2 (0.17.2)
usermods/user_fx/README.md
291-291: Emphasis used instead of a heading
null
(MD036, no-emphasis-as-heading)
🔇 Additional comments (4)
usermods/user_fx/README.md (4)
58-64: XY helper ignores WLED’s matrix mapping helpersThe custom
XY = [&](int x, int y) { return x + y * cols; };assumes a simple row-major layout and will render incorrectly on serpentine or origin-flipped matrices.
Either:
- Note this limitation explicitly in the text, or
- Recommend
uint16_t XY(uint8_t x, uint8_t y)fromFX.h, which honours the user-selected matrix layout.Failure to clarify will confuse readers whose panel is not wired in strict row-major order.
44-45: Unresolved TODO placeholderThe “Static Effect Definition” section still contains
TODO. Please either complete this explanation or remove the placeholder before merging; unfinished sections reduce the credibility of the guide.
239-240: Metadata breakdown marked as TODOThe promise to “break it down field by field” is valuable—especially for newcomers—but the section is empty. Filling this out will prevent a flood of identical questions in Issues/Discord.
291-292: 1 D effects section is empty
## Understanding 1D WLED Effectscurrently consists only of a TODO. Either provide at least one concrete example (e.g. re-implementing a simple “Chase”) or defer the heading until content is ready.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (3)
usermods/user_fx/README.md (3)
3-3: Typo: “depracated” → “deprecated”- ...or to load in depracated WLED effects... + ...or to load in deprecated WLED effects...
17-17: Typo: “abour” should be “about”- ...and how to go abour creating your own... + ...and how to go about creating your own...
54-56: Minor code accuracy
strip.isMatrixalone is sufficient; the additionalSEGMENT.is2D()check is redundant becausestrip.isMatrixalready implies a 2-D setup. Consider simplifying to improve clarity:-if (!strip.isMatrix || !SEGMENT.is2D()) +if (!strip.isMatrix) return mode_static();
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
usermods/user_fx/README.md(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: willmmiles
PR: wled/WLED#4623
File: usermods/word-clock-matrix/word-clock-matrix.cpp:332-332
Timestamp: 2025-03-29T01:22:54.617Z
Learning: In the WLED project, hardcoded usermod IDs (like 500 in the WordClockMatrix's getId() method) are intentionally used as part of a strategy to avoid modifying core code. There are plans to remove numeric usermod IDs entirely in the future.
Learnt from: netmindz
PR: wled/WLED#4728
File: wled00/FX.h:378-378
Timestamp: 2025-06-15T09:59:52.720Z
Learning: In WLED's FX.h, MODE_COUNT represents the highest FX_MODE_ ID + 1, not the total count of FX_MODE_ definitions. This is because some effects may have been removed but their IDs are not reused, creating gaps in the numbering sequence. MODE_COUNT is used for array bounds and range checking.
Learnt from: netmindz
PR: wled/WLED#4728
File: wled00/FX.h:378-378
Timestamp: 2025-06-15T09:59:52.720Z
Learning: In WLED's FX.h, MODE_COUNT represents the highest FX_MODE_ ID + 1, not the total count of FX_MODE_ definitions. This is because some effects may have been removed but their IDs are not reused, creating gaps in the numbering sequence. MODE_COUNT is used for array bounds and range checking.
Learnt from: KrX3D
PR: wled/WLED#4237
File: usermods/INA219_v2/INA219_v2.cpp:265-276
Timestamp: 2025-04-18T22:27:58.634Z
Learning: When implementing MQTT message handling in WLED usermods, use `strstr(topic, "/specific/path")` instead of `strcmp_P(topic, PSTR("/specific/path"))` to properly match topics that include the device prefix. The full MQTT topic typically follows the pattern `<mqttDeviceTopic>/specific/path`.
Learnt from: DedeHai
PR: wled/WLED#4750
File: usermods/audioreactive/audio_reactive.cpp:311-321
Timestamp: 2025-06-27T06:04:44.622Z
Learning: In WLED's AudioReactive usermod, FFT buffer memory (valFFT, windowFFT) is allocated once during initialization and never deallocated, following typical embedded system design where core functionality buffers persist for the application lifetime. Raw buffer pointers for aligned allocations don't need to be tracked in the current implementation since deallocation is never performed.
usermods/user_fx/README.md (5)
Learnt from: netmindz
PR: wled/WLED#4728
File: wled00/FX.h:378-378
Timestamp: 2025-06-15T09:59:52.720Z
Learning: In WLED's FX.h, MODE_COUNT represents the highest FX_MODE_ ID + 1, not the total count of FX_MODE_ definitions. This is because some effects may have been removed but their IDs are not reused, creating gaps in the numbering sequence. MODE_COUNT is used for array bounds and range checking.
Learnt from: netmindz
PR: wled/WLED#4728
File: wled00/FX.h:378-378
Timestamp: 2025-06-15T09:59:52.720Z
Learning: In WLED's FX.h, MODE_COUNT represents the highest FX_MODE_ ID + 1, not the total count of FX_MODE_ definitions. This is because some effects may have been removed but their IDs are not reused, creating gaps in the numbering sequence. MODE_COUNT is used for array bounds and range checking.
Learnt from: willmmiles
PR: wled/WLED#4623
File: usermods/word-clock-matrix/word-clock-matrix.cpp:332-332
Timestamp: 2025-03-29T01:22:54.617Z
Learning: In the WLED project, hardcoded usermod IDs (like 500 in the WordClockMatrix's getId() method) are intentionally used as part of a strategy to avoid modifying core code. There are plans to remove numeric usermod IDs entirely in the future.
Learnt from: KrX3D
PR: wled/WLED#4237
File: usermods/INA219_v2/INA219_v2.cpp:265-276
Timestamp: 2025-04-18T22:27:58.634Z
Learning: When implementing MQTT message handling in WLED usermods, use `strstr(topic, "/specific/path")` instead of `strcmp_P(topic, PSTR("/specific/path"))` to properly match topics that include the device prefix. The full MQTT topic typically follows the pattern `<mqttDeviceTopic>/specific/path`.
Learnt from: DedeHai
PR: wled/WLED#4682
File: wled00/FX.cpp:9016-9039
Timestamp: 2025-05-09T18:48:21.296Z
Learning: WLED does not support matrices large enough (≥1024 px) for 32-bit overflow in dx*dx + dy*dy to be a practical concern in particle system effects.
🪛 LanguageTool
usermods/user_fx/README.md
[style] ~13-~13: Consider removing “of” to be more concise
Context: ...area is where you place the FX code for all of the custom effects you want to use. This m...
(ALL_OF_THE)
[style] ~15-~15: As a shorter alternative for ‘able to’, consider using “can”.
Context: ...mods have to be registered so that they are able to be compiled into your binary. We will ...
(BE_ABLE_TO)
[style] ~15-~15: Avoid the passive voice after ‘to be able to’.
Context: ... be registered so that they are able to be compiled into your binary. We will go into grea...
(ABLE_TO_PASSIVE)
[uncategorized] ~27-~27: You might be missing the article “a” here.
Context: ...be changed at any time if the user sets new segment size(s). | | `SEGCOLOR(x) / SE...
(AI_EN_LECTOR_MISSING_DETERMINER_A)
[typographical] ~36-~36: It appears that a comma is missing.
Context: ... Understanding 2D WLED Effects In this section we give some advice to those who are ne...
(DURING_THAT_TIME_COMMA)
[uncategorized] ~40-~40: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...le. This file handles all other imports and it has all the global variable declarat...
(COMMA_COMPOUND_SENTENCE)
[uncategorized] ~57-~57: Possible missing comma found.
Context: ...lock contains several constant variable definitions which essentially serve to extract the ...
(AI_HYDRA_LEO_MISSING_COMMA)
[misspelling] ~78-~78: Nonstandard phrase. Did you mean: “from 0 to 255”?
Context: ...MENT.speed (user-controllable parameter from 0–255) to a value between 20 and 80 Hz. * T...
(FROM_X_Y)
[uncategorized] ~80-~80: Possible missing comma found.
Context: ...gher speed = more frames per second). * Next we convert refresh rate from Hz to mill...
(AI_HYDRA_LEO_MISSING_COMMA)
[uncategorized] ~80-~80: You might be missing the article “the” here.
Context: ...e frames per second). * Next we convert refresh rate from Hz to milliseconds. (It’s eas...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[uncategorized] ~84-~84: Possible missing comma found.
Context: ...re diffusion = smoother flame spread. * Next we assign SEGMENT.intensity (user inp...
(AI_HYDRA_LEO_MISSING_COMMA)
[uncategorized] ~106-~106: You might be missing the article “the” here.
Context: ...nd the effect can’t proceed. * It calls previously defined mode_static() fallback effect...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[uncategorized] ~135-~135: The preposition “of” seems more likely in this position.
Context: ...conditional statement in the first line fo code ensures the effect updates on a fi...
(AI_EN_LECTOR_REPLACEMENT_PREPOSITION)
[uncategorized] ~153-~153: Possible missing preposition found.
Context: ...whether we even attempt to spawn sparks this frame. * hw_random8() gives another...
(AI_HYDRA_LEO_MISSING_IN)
[uncategorized] ~184-~184: Possible missing article found.
Context: ...Starting with the current heat value of pixel (x, y) assigned v: * if there’s a p...
(AI_HYDRA_LEO_MISSING_A)
[uncategorized] ~209-~209: Possible missing comma found.
Context: ... color-rendering for each pixel row.) * Next we update the main segment data with th...
(AI_HYDRA_LEO_MISSING_COMMA)
[grammar] ~211-~211: Use the plural noun “” with the number ‘255’.
Context: ...olor` from the current palette with 255 brightness, and no wrapping in palette lookup. *...
(IN_CD_PUNCTUATION)
[typographical] ~213-~213: Consider adding a comma after ‘Finally’ for more clarity.
Context: ... flames (e.g., yellow → red → black). * Finally we set the rendered color for the pixel...
(RB_LY_COMMA)
[grammar] ~215-~215: The word “fallback” is a noun. The verb is spelled with a space.
Context: ...h row. * If palette use is disabled, we fallback to fading a base color. * SEGCOLOR(0)...
(NOUN_VERB_CONFUSION)
[grammar] ~235-~235: Did you mean the adverb/preposition “within”?
Context: ...ines how the effect is to be interacted with in the UI: ```cpp static const char data...
(WITH_IN)
[uncategorized] ~274-~274: Possible missing comma found.
Context: ...important one that registers the custom effect so WLED knows about it. * 255: Tempor...
(AI_HYDRA_LEO_MISSING_COMMA)
[uncategorized] ~277-~277: Loose punctuation mark.
Context: ...ction. * _data_FX_MODE_DIFFUSIONFIRE: Metadata string stored in PROGMEM, desc...
(UNLIKELY_OPENING_PUNCTUATION)
🪛 markdownlint-cli2 (0.17.2)
usermods/user_fx/README.md
25-25: Table pipe style
Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe
(MD055, table-pipe-style)
295-295: Emphasis used instead of a heading
null
(MD036, no-emphasis-as-heading)
🔇 Additional comments (3)
usermods/user_fx/README.md (3)
48-50: Unresolved TODO leaves the reader without the promised exampleThe “Static Effect Definition” section introduces a
TODObut never provides an example fallback effect. Either supply a concrete snippet or remove the placeholder before merging.
233-244: Metadata walkthrough section still marked TODOLines 241-243 promise a field-by-field breakdown of the metadata string but end with
**TODO**. The README is the primary reference for new users; leaving this blank reduces its value.
293-296: Missing 1 D effect sectionThe heading “## Understanding 1D WLED Effects” is followed only by
**TODO**. Either flesh this out or drop the heading to avoid confusing readers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
♻️ Duplicate comments (1)
usermods/user_fx/README.md (1)
23-31: Table breaks markdown-lint & still contains placeholders
- Trailing pipes are missing (
MD055violation).- “Size” column has
???placeholders – replace with actual widths orvaries.- Align wording with the rest of the doc.
-| Syntax Element | Size | Description | -| :---------------------------------------------- | :----- | :---------- | -| `SEGMENT.intensity / speed / custom1 etc.` | 8-bit | This syntax helps define the UI sliders that can make certain elements of your running code editable by the user. (These can be controlled by the API as well.) -| `SEGENV.call / step / aux0 / aux1` | ???? | These are useful counters for you to use in your code. | -| `SEGLEN / SEG_W / SEG_H` | ??? | These variables are macros that help define the length and width of your LED strip/matrix segment. They can be changed at any time if the user sets new segment size(s). | -| `SEGCOLOR(x) / SEGPALETTE` | ??? | For user colors from UI (and how it relates to meta string) | -| `SEGMENT.color_from_palette()` | ??? | function which should be favoured over ColorFromPalette() | +| Syntax Element | Size | Description | +| :---------------------------------------------- | :------ | :--------------------------------------------------------------------------------------------------------------------------------------- | +| `SEGMENT.intensity`, `speed`, `custom1…` | 8-bit | User-controllable sliders (also writable via the JSON/API). | +| `SEGENV.call`, `step`, `aux0`, `aux1` | 32-bit | Per-effect counters / scratch registers. | +| `SEGLEN`, `SEG_W`, `SEG_H` | 16-bit | Current segment length, width, height. Values update if the user changes segment size. | +| `SEGCOLOR(x)`, `SEGPALETTE` | varies | User-selected colors or palette index for the segment. | +| `SEGMENT.color_from_palette()` | — | Preferred helper that respects palette + brightness; use instead of `ColorFromPalette()`. |
🧹 Nitpick comments (8)
usermods/user_fx/README.md (8)
3-6: Fix spelling and tighten wording in intro“depracated” → “deprecated”
The sentence is also a bit wordy; trimming improves clarity.-This Usermod is a common place to put various user's WLED Effects. It gives you a way to load in your own custom WLED effects, or to load in depracated WLED effects that you want to bring back--all without having to mess with the core WLED source code. +This usermod is a central place for custom WLED effects. It lets you load your own or bring back deprecated effects—without touching the core WLED source.
17-18: Typo: “abour” → “about”-We will go into greater detail on how custom effects work in the usermod and how to go abour creating your own in the section below. +We will go into greater detail on how custom effects work in the usermod and how to go about creating your own in the section below.
31-32: Dangling sentence needs context“explaining available functions for pixel drawing …” is an orphaned note. Either turn it into a heading with content or remove.
36-38: Missing comma in complex sentenceAdd a comma after “Effects” to avoid a run-on.
-In this section we give some advice to those who are new to WLED Effect creation. +In this section, we give some advice to those who are new to WLED effect creation.
169-180: Division constant could overflow on large matrices
v * 100usesintmultiplication; for largev(up to 3×255) the product fits, but if future code raisesvto 16-bit heat values it will overflow. Consider casting touint16_tor using 8-bit arithmetic for safety.
250-251: Typos: “tep” → “step”-we will break this effect down tep by step. +We will break this effect down step by step.
366-371: Spelling: “speicfy” → “specify”-And then the last part defines the metadata strings for each effect to speicfy how it will be portrayed in the UI: +Finally, the metadata strings below specify how each variant appears in the UI:
413-420: Spelling: “instatiation” → “instantiation”-The final part of this file handles instatiation and initialization: +The final part of this file handles instantiation and initialization:
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
usermods/user_fx/README.md(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: willmmiles
PR: wled/WLED#4623
File: usermods/word-clock-matrix/word-clock-matrix.cpp:332-332
Timestamp: 2025-03-29T01:22:54.617Z
Learning: In the WLED project, hardcoded usermod IDs (like 500 in the WordClockMatrix's getId() method) are intentionally used as part of a strategy to avoid modifying core code. There are plans to remove numeric usermod IDs entirely in the future.
Learnt from: netmindz
PR: wled/WLED#4728
File: wled00/FX.h:378-378
Timestamp: 2025-06-15T09:59:52.720Z
Learning: In WLED's FX.h, MODE_COUNT represents the highest FX_MODE_ ID + 1, not the total count of FX_MODE_ definitions. This is because some effects may have been removed but their IDs are not reused, creating gaps in the numbering sequence. MODE_COUNT is used for array bounds and range checking.
Learnt from: netmindz
PR: wled/WLED#4728
File: wled00/FX.h:378-378
Timestamp: 2025-06-15T09:59:52.720Z
Learning: In WLED's FX.h, MODE_COUNT represents the highest FX_MODE_ ID + 1, not the total count of FX_MODE_ definitions. This is because some effects may have been removed but their IDs are not reused, creating gaps in the numbering sequence. MODE_COUNT is used for array bounds and range checking.
Learnt from: KrX3D
PR: wled/WLED#4237
File: usermods/INA219_v2/INA219_v2.cpp:265-276
Timestamp: 2025-04-18T22:27:58.634Z
Learning: When implementing MQTT message handling in WLED usermods, use `strstr(topic, "/specific/path")` instead of `strcmp_P(topic, PSTR("/specific/path"))` to properly match topics that include the device prefix. The full MQTT topic typically follows the pattern `<mqttDeviceTopic>/specific/path`.
Learnt from: DedeHai
PR: wled/WLED#4750
File: usermods/audioreactive/audio_reactive.cpp:311-321
Timestamp: 2025-06-27T06:04:44.652Z
Learning: In WLED's AudioReactive usermod, FFT buffer memory (valFFT, windowFFT) is allocated once during initialization and never deallocated, following typical embedded system design where core functionality buffers persist for the application lifetime. Raw buffer pointers for aligned allocations don't need to be tracked in the current implementation since deallocation is never performed.
usermods/user_fx/README.md (8)
Learnt from: netmindz
PR: wled/WLED#4728
File: wled00/FX.h:378-378
Timestamp: 2025-06-15T09:59:52.720Z
Learning: In WLED's FX.h, MODE_COUNT represents the highest FX_MODE_ ID + 1, not the total count of FX_MODE_ definitions. This is because some effects may have been removed but their IDs are not reused, creating gaps in the numbering sequence. MODE_COUNT is used for array bounds and range checking.
Learnt from: netmindz
PR: wled/WLED#4728
File: wled00/FX.h:378-378
Timestamp: 2025-06-15T09:59:52.720Z
Learning: In WLED's FX.h, MODE_COUNT represents the highest FX_MODE_ ID + 1, not the total count of FX_MODE_ definitions. This is because some effects may have been removed but their IDs are not reused, creating gaps in the numbering sequence. MODE_COUNT is used for array bounds and range checking.
Learnt from: willmmiles
PR: wled/WLED#4623
File: usermods/word-clock-matrix/word-clock-matrix.cpp:332-332
Timestamp: 2025-03-29T01:22:54.617Z
Learning: In the WLED project, hardcoded usermod IDs (like 500 in the WordClockMatrix's getId() method) are intentionally used as part of a strategy to avoid modifying core code. There are plans to remove numeric usermod IDs entirely in the future.
Learnt from: DedeHai
PR: wled/WLED#4750
File: usermods/audioreactive/audio_reactive.cpp:311-321
Timestamp: 2025-06-27T06:04:44.652Z
Learning: In WLED's AudioReactive usermod, FFT buffer memory (valFFT, windowFFT) is allocated once during initialization and never deallocated, following typical embedded system design where core functionality buffers persist for the application lifetime. Raw buffer pointers for aligned allocations don't need to be tracked in the current implementation since deallocation is never performed.
Learnt from: KrX3D
PR: wled/WLED#4237
File: usermods/INA219_v2/INA219_v2.cpp:265-276
Timestamp: 2025-04-18T22:27:58.634Z
Learning: When implementing MQTT message handling in WLED usermods, use `strstr(topic, "/specific/path")` instead of `strcmp_P(topic, PSTR("/specific/path"))` to properly match topics that include the device prefix. The full MQTT topic typically follows the pattern `<mqttDeviceTopic>/specific/path`.
Learnt from: DedeHai
PR: wled/WLED#4682
File: wled00/FX.cpp:9016-9039
Timestamp: 2025-05-09T18:48:21.296Z
Learning: WLED does not support matrices large enough (≥1024 px) for 32-bit overflow in dx*dx + dy*dy to be a practical concern in particle system effects.
Learnt from: blazoncek
PR: wled/WLED#4667
File: usermods/user_fx/user_fx.cpp:27-30
Timestamp: 2025-04-30T05:41:03.633Z
Learning: In WLED, the Segment::allocateData() method already includes optimization to check if data is allocated and sufficiently sized, handling buffer reuse to reduce memory fragmentation. Adding an external check like `if (SEGENV.data == nullptr && !SEGENV.allocateData(dataSize))` is unnecessary and could be problematic, as it bypasses proper size verification.
Learnt from: KrX3D
PR: wled/WLED#4585
File: usermods/seven_segment_display_reloaded_v2/seven_segment_display_reloaded_v2.h:121-137
Timestamp: 2025-04-27T10:06:22.545Z
Learning: In the Seven Segment Display Reloaded usermod, the dimension mismatch between the default array (umSSDRNumbers[11][7]) and the override (umSSDRNumbers[11][10] = umSSDR_NUMBERS) is intentional by design, allowing for different use cases with varying numbers of segments per digit.
🪛 LanguageTool
usermods/user_fx/README.md
[style] ~13-~13: Consider removing “of” to be more concise
Context: ...area is where you place the FX code for all of the custom effects you want to use. This m...
(ALL_OF_THE)
[style] ~15-~15: As a shorter alternative for ‘able to’, consider using “can”.
Context: ...mods have to be registered so that they are able to be compiled into your binary. We will ...
(BE_ABLE_TO)
[style] ~15-~15: Avoid the passive voice after ‘to be able to’.
Context: ... be registered so that they are able to be compiled into your binary. We will go into grea...
(ABLE_TO_PASSIVE)
[uncategorized] ~27-~27: You might be missing the article “a” here.
Context: ...be changed at any time if the user sets new segment size(s). | | `SEGCOLOR(x) / SE...
(AI_EN_LECTOR_MISSING_DETERMINER_A)
[typographical] ~36-~36: It appears that a comma is missing.
Context: ... Understanding 2D WLED Effects In this section we give some advice to those who are ne...
(DURING_THAT_TIME_COMMA)
[uncategorized] ~40-~40: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...le. This file handles all other imports and it has all the global variable declarat...
(COMMA_COMPOUND_SENTENCE)
[uncategorized] ~57-~57: Possible missing comma found.
Context: ...lock contains several constant variable definitions which essentially serve to extract the ...
(AI_HYDRA_LEO_MISSING_COMMA)
[misspelling] ~78-~78: Nonstandard phrase. Did you mean: “from 0 to 255”?
Context: ...MENT.speed (user-controllable parameter from 0–255) to a value between 20 and 80 Hz. * T...
(FROM_X_Y)
[uncategorized] ~80-~80: Possible missing comma found.
Context: ...gher speed = more frames per second). * Next we convert refresh rate from Hz to mill...
(AI_HYDRA_LEO_MISSING_COMMA)
[uncategorized] ~80-~80: You might be missing the article “the” here.
Context: ...e frames per second). * Next we convert refresh rate from Hz to milliseconds. (It’s eas...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[uncategorized] ~84-~84: Possible missing comma found.
Context: ...re diffusion = smoother flame spread. * Next we assign SEGMENT.intensity (user inp...
(AI_HYDRA_LEO_MISSING_COMMA)
[uncategorized] ~106-~106: You might be missing the article “the” here.
Context: ...nd the effect can’t proceed. * It calls previously defined mode_static() fallback effect...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[uncategorized] ~135-~135: The preposition “of” seems more likely in this position.
Context: ...conditional statement in the first line fo code ensures the effect updates on a fi...
(AI_EN_LECTOR_REPLACEMENT_PREPOSITION)
[uncategorized] ~153-~153: Possible missing preposition found.
Context: ...whether we even attempt to spawn sparks this frame. * hw_random8() gives another...
(AI_HYDRA_LEO_MISSING_IN)
[uncategorized] ~184-~184: Possible missing article found.
Context: ...Starting with the current heat value of pixel (x, y) assigned v: * if there’s a p...
(AI_HYDRA_LEO_MISSING_A)
[uncategorized] ~209-~209: Possible missing comma found.
Context: ... color-rendering for each pixel row.) * Next we update the main segment data with th...
(AI_HYDRA_LEO_MISSING_COMMA)
[grammar] ~211-~211: Use the plural noun “” with the number ‘255’.
Context: ...olor` from the current palette with 255 brightness, and no wrapping in palette lookup. *...
(IN_CD_PUNCTUATION)
[typographical] ~213-~213: Consider adding a comma after ‘Finally’ for more clarity.
Context: ... flames (e.g., yellow → red → black). * Finally we set the rendered color for the pixel...
(RB_LY_COMMA)
[grammar] ~215-~215: The word “fallback” is a noun. The verb is spelled with a space.
Context: ...h row. * If palette use is disabled, we fallback to fading a base color. * SEGCOLOR(0)...
(NOUN_VERB_CONFUSION)
[grammar] ~235-~235: Did you mean the adverb/preposition “within”?
Context: ...ines how the effect is to be interacted with in the UI: ```cpp static const char data...
(WITH_IN)
[uncategorized] ~256-~256: You might be missing the article “a” here.
Context: ... line of code defines sinelon base as static helper function. This is how all effec...
(AI_EN_LECTOR_MISSING_DETERMINER_A)
[uncategorized] ~288-~288: Loose punctuation mark.
Context: ...2_t color2 = SEGCOLOR(2); ``` * color1: main moving dot color, chosen from pale...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~288-~288: You might be missing the article “a” here.
Context: ...r1`: main moving dot color, chosen from palette using the current position as index. * ...
(AI_EN_LECTOR_MISSING_DETERMINER_A)
[uncategorized] ~289-~289: Loose punctuation mark.
Context: ...he current position as index. * color2: secondary color from user-configured co...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~291-~291: This word is normally spelled with a hyphen.
Context: ... account the optional argument for if a Rainbow colored palette is in use: ```cpp if (rainbow...
(RAINBOW_COLORED)
[style] ~305-~305: ‘takes into account’ might be wordy. Consider a shorter alternative.
Context: ...with the selected color. The next line takes into account another one of the optional arguments f...
(EN_WORDINESS_PREMIUM_TAKES_INTO_ACCOUNT)
[uncategorized] ~305-~305: Possible missing comma found.
Context: ...ect to potentially handle dual mirrored dots which create the animation: ```cpp if...
(AI_HYDRA_LEO_MISSING_COMMA)
[uncategorized] ~315-~315: You might be missing the article “the” here.
Context: ...If color2 is not set (0), fallback to same palette color as color1. * In `rain...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[uncategorized] ~335-~335: You might be missing the article “the” here.
Context: ...pos; } ``` * The first line checks if current position has changed since last frame. ...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[grammar] ~335-~335: The verb form ‘has’ does not seem to match the subject ‘checks’.
Context: ...e first line checks if current position has changed since last frame. (Prevents ho...
(SUBJECT_VERB_AGREEMENT_PLURAL)
[uncategorized] ~335-~335: You might be missing the article “the” here.
Context: ...s if current position has changed since last frame. (Prevents holes if the dot move...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[uncategorized] ~336-~336: You might be missing the article “a” here.
Context: ....aux0) and new position (pos) to ensure smooth continuous trail. * Works in both dir...
(AI_EN_LECTOR_MISSING_DETERMINER_A)
[uncategorized] ~403-~403: Possible missing comma found.
Context: ...important one that registers the custom effect so WLED knows about it. * 255: Tempor...
(AI_HYDRA_LEO_MISSING_COMMA)
[uncategorized] ~406-~406: Loose punctuation mark.
Context: ...ction. * _data_FX_MODE_DIFFUSIONFIRE: Metadata string stored in PROGMEM, desc...
(UNLIKELY_OPENING_PUNCTUATION)
🪛 markdownlint-cli2 (0.17.2)
usermods/user_fx/README.md
25-25: Table pipe style
Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe
(MD055, table-pipe-style)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Nitpick comments (4)
usermods/user_fx/README.md (4)
3-3: Spelling nit: “depracated” → “deprecated”.Minor typo in the first paragraph; polish the wording for professionalism.
-...or to load in depracated WLED effects... +...or to load in deprecated WLED effects...
48-48: Remove or fulfil “TODO” fallback-effect example.Leaving TODOs in published docs makes the guide look unfinished. Provide a minimal fallback snippet or delete the note.
244-253: Parameter table uses hard tabs and violates MD010/MD055.Hard tabs mis-align columns and the trailing pipes are missing, causing markdown-lint errors and rendering issues.
-| Parameter | Default tooltip label | -| sx | Effect speed | -| ix | Effect intensity | -| c1 | Custom 1 | -| c2 | Custom 2 | -| c3 | Custom 3 | -| o1 | Option 1 | -| o2 | Option 2 | -| o3 | Option 3 | +| Parameter | Default tooltip label | +| :-------- | :-------------------- | +| `sx` | Effect speed | +| `ix` | Effect intensity | +| `c1` | Custom 1 | +| `c2` | Custom 2 | +| `c3` | Custom 3 | +| `o1` | Option 1 | +| `o2` | Option 2 | +| `o3` | Option 3 |
396-396: Typo: “speicfy” → “specify”.-...metadata strings for each effect to speicfy how it will be portrayed in the UI: +...metadata strings for each effect to specify how it will be portrayed in the UI:
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
usermods/user_fx/README.md(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: willmmiles
PR: wled/WLED#4623
File: usermods/word-clock-matrix/word-clock-matrix.cpp:332-332
Timestamp: 2025-03-29T01:22:54.617Z
Learning: In the WLED project, hardcoded usermod IDs (like 500 in the WordClockMatrix's getId() method) are intentionally used as part of a strategy to avoid modifying core code. There are plans to remove numeric usermod IDs entirely in the future.
Learnt from: netmindz
PR: wled/WLED#4728
File: wled00/FX.h:378-378
Timestamp: 2025-06-15T09:59:52.720Z
Learning: In WLED's FX.h, MODE_COUNT represents the highest FX_MODE_ ID + 1, not the total count of FX_MODE_ definitions. This is because some effects may have been removed but their IDs are not reused, creating gaps in the numbering sequence. MODE_COUNT is used for array bounds and range checking.
Learnt from: netmindz
PR: wled/WLED#4728
File: wled00/FX.h:378-378
Timestamp: 2025-06-15T09:59:52.720Z
Learning: In WLED's FX.h, MODE_COUNT represents the highest FX_MODE_ ID + 1, not the total count of FX_MODE_ definitions. This is because some effects may have been removed but their IDs are not reused, creating gaps in the numbering sequence. MODE_COUNT is used for array bounds and range checking.
Learnt from: KrX3D
PR: wled/WLED#4237
File: usermods/INA219_v2/INA219_v2.cpp:265-276
Timestamp: 2025-04-18T22:27:58.634Z
Learning: When implementing MQTT message handling in WLED usermods, use `strstr(topic, "/specific/path")` instead of `strcmp_P(topic, PSTR("/specific/path"))` to properly match topics that include the device prefix. The full MQTT topic typically follows the pattern `<mqttDeviceTopic>/specific/path`.
Learnt from: DedeHai
PR: wled/WLED#4750
File: usermods/audioreactive/audio_reactive.cpp:311-321
Timestamp: 2025-06-27T06:04:44.652Z
Learning: In WLED's AudioReactive usermod, FFT buffer memory (valFFT, windowFFT) is allocated once during initialization and never deallocated, following typical embedded system design where core functionality buffers persist for the application lifetime. Raw buffer pointers for aligned allocations don't need to be tracked in the current implementation since deallocation is never performed.
usermods/user_fx/README.md (7)
Learnt from: netmindz
PR: wled/WLED#4728
File: wled00/FX.h:378-378
Timestamp: 2025-06-15T09:59:52.720Z
Learning: In WLED's FX.h, MODE_COUNT represents the highest FX_MODE_ ID + 1, not the total count of FX_MODE_ definitions. This is because some effects may have been removed but their IDs are not reused, creating gaps in the numbering sequence. MODE_COUNT is used for array bounds and range checking.
Learnt from: netmindz
PR: wled/WLED#4728
File: wled00/FX.h:378-378
Timestamp: 2025-06-15T09:59:52.720Z
Learning: In WLED's FX.h, MODE_COUNT represents the highest FX_MODE_ ID + 1, not the total count of FX_MODE_ definitions. This is because some effects may have been removed but their IDs are not reused, creating gaps in the numbering sequence. MODE_COUNT is used for array bounds and range checking.
Learnt from: willmmiles
PR: wled/WLED#4623
File: usermods/word-clock-matrix/word-clock-matrix.cpp:332-332
Timestamp: 2025-03-29T01:22:54.617Z
Learning: In the WLED project, hardcoded usermod IDs (like 500 in the WordClockMatrix's getId() method) are intentionally used as part of a strategy to avoid modifying core code. There are plans to remove numeric usermod IDs entirely in the future.
Learnt from: KrX3D
PR: wled/WLED#4237
File: usermods/INA219_v2/INA219_v2.cpp:265-276
Timestamp: 2025-04-18T22:27:58.634Z
Learning: When implementing MQTT message handling in WLED usermods, use `strstr(topic, "/specific/path")` instead of `strcmp_P(topic, PSTR("/specific/path"))` to properly match topics that include the device prefix. The full MQTT topic typically follows the pattern `<mqttDeviceTopic>/specific/path`.
Learnt from: DedeHai
PR: wled/WLED#4682
File: wled00/FX.cpp:9016-9039
Timestamp: 2025-05-09T18:48:21.296Z
Learning: WLED does not support matrices large enough (≥1024 px) for 32-bit overflow in dx*dx + dy*dy to be a practical concern in particle system effects.
Learnt from: blazoncek
PR: wled/WLED#4667
File: usermods/user_fx/user_fx.cpp:27-30
Timestamp: 2025-04-30T05:41:03.633Z
Learning: In WLED, the Segment::allocateData() method already includes optimization to check if data is allocated and sufficiently sized, handling buffer reuse to reduce memory fragmentation. Adding an external check like `if (SEGENV.data == nullptr && !SEGENV.allocateData(dataSize))` is unnecessary and could be problematic, as it bypasses proper size verification.
Learnt from: KrX3D
PR: wled/WLED#4585
File: usermods/seven_segment_display_reloaded_v2/seven_segment_display_reloaded_v2.h:121-137
Timestamp: 2025-04-27T10:06:22.545Z
Learning: In the Seven Segment Display Reloaded usermod, the dimension mismatch between the default array (umSSDRNumbers[11][7]) and the override (umSSDRNumbers[11][10] = umSSDR_NUMBERS) is intentional by design, allowing for different use cases with varying numbers of segments per digit.
🪛 LanguageTool
usermods/user_fx/README.md
[style] ~13-~13: Consider removing “of” to be more concise
Context: ...area is where you place the FX code for all of the custom effects you want to use. This m...
(ALL_OF_THE)
[style] ~15-~15: As a shorter alternative for ‘able to’, consider using “can”.
Context: ...mods have to be registered so that they are able to be compiled into your binary. We will ...
(BE_ABLE_TO)
[style] ~15-~15: Avoid the passive voice after ‘to be able to’.
Context: ... be registered so that they are able to be compiled into your binary. We will go into grea...
(ABLE_TO_PASSIVE)
[uncategorized] ~27-~27: You might be missing the article “a” here.
Context: ...be changed at any time if the user sets new segment size(s). | | `SEGCOLOR(x) / SE...
(AI_EN_LECTOR_MISSING_DETERMINER_A)
[typographical] ~36-~36: It appears that a comma is missing.
Context: ... Understanding 2D WLED Effects In this section we give some advice to those who are ne...
(DURING_THAT_TIME_COMMA)
[uncategorized] ~40-~40: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...le. This file handles all other imports and it has all the global variable declarat...
(COMMA_COMPOUND_SENTENCE)
[uncategorized] ~57-~57: Possible missing comma found.
Context: ...lock contains several constant variable definitions which essentially serve to extract the ...
(AI_HYDRA_LEO_MISSING_COMMA)
[misspelling] ~78-~78: Nonstandard phrase. Did you mean: “from 0 to 255”?
Context: ...MENT.speed (user-controllable parameter from 0–255) to a value between 20 and 80 Hz. * T...
(FROM_X_Y)
[uncategorized] ~80-~80: Possible missing comma found.
Context: ...gher speed = more frames per second). * Next we convert refresh rate from Hz to mill...
(AI_HYDRA_LEO_MISSING_COMMA)
[uncategorized] ~80-~80: You might be missing the article “the” here.
Context: ...e frames per second). * Next we convert refresh rate from Hz to milliseconds. (It’s eas...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[uncategorized] ~84-~84: Possible missing comma found.
Context: ...re diffusion = smoother flame spread. * Next we assign SEGMENT.intensity (user inp...
(AI_HYDRA_LEO_MISSING_COMMA)
[uncategorized] ~106-~106: You might be missing the article “the” here.
Context: ...nd the effect can’t proceed. * It calls previously defined mode_static() fallback effect...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[uncategorized] ~135-~135: The preposition “of” seems more likely in this position.
Context: ...conditional statement in the first line fo code ensures the effect updates on a fi...
(AI_EN_LECTOR_REPLACEMENT_PREPOSITION)
[uncategorized] ~153-~153: Possible missing preposition found.
Context: ...whether we even attempt to spawn sparks this frame. * hw_random8() gives another...
(AI_HYDRA_LEO_MISSING_IN)
[uncategorized] ~184-~184: Possible missing article found.
Context: ...Starting with the current heat value of pixel (x, y) assigned v: * if there’s a p...
(AI_HYDRA_LEO_MISSING_A)
[uncategorized] ~209-~209: Possible missing comma found.
Context: ... color-rendering for each pixel row.) * Next we update the main segment data with th...
(AI_HYDRA_LEO_MISSING_COMMA)
[grammar] ~211-~211: Use the plural noun “” with the number ‘255’.
Context: ...olor` from the current palette with 255 brightness, and no wrapping in palette lookup. *...
(IN_CD_PUNCTUATION)
[typographical] ~213-~213: Consider adding a comma after ‘Finally’ for more clarity.
Context: ... flames (e.g., yellow → red → black). * Finally we set the rendered color for the pixel...
(RB_LY_COMMA)
[grammar] ~215-~215: The word “fallback” is a noun. The verb is spelled with a space.
Context: ...h row. * If palette use is disabled, we fallback to fading a base color. * SEGCOLOR(0)...
(NOUN_VERB_CONFUSION)
[grammar] ~236-~236: Did you mean the adverb/preposition “within”?
Context: ...ines how the effect is to be interacted with in the UI: ```cpp static const char data...
(WITH_IN)
[typographical] ~262-~262: The word “otherwise” is an adverb that can’t be used like a conjunction, and therefore needs to be separated from the sentence.
Context: ...ffect uses a palette (ColorFromPalette()), otherwise it fades from SEGCOLOR(0). The first ...
(THUS_SENTENCE)
[uncategorized] ~286-~286: You might be missing the article “a” here.
Context: ... line of code defines sinelon base as static helper function. This is how all effec...
(AI_EN_LECTOR_MISSING_DETERMINER_A)
[uncategorized] ~318-~318: Loose punctuation mark.
Context: ...2_t color2 = SEGCOLOR(2); ``` * color1: main moving dot color, chosen from pale...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~318-~318: You might be missing the article “a” here.
Context: ...r1`: main moving dot color, chosen from palette using the current position as index. * ...
(AI_EN_LECTOR_MISSING_DETERMINER_A)
[uncategorized] ~319-~319: Loose punctuation mark.
Context: ...he current position as index. * color2: secondary color from user-configured co...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~321-~321: This word is normally spelled with a hyphen.
Context: ... account the optional argument for if a Rainbow colored palette is in use: ```cpp if (rainbow...
(RAINBOW_COLORED)
[style] ~335-~335: ‘takes into account’ might be wordy. Consider a shorter alternative.
Context: ...with the selected color. The next line takes into account another one of the optional arguments f...
(EN_WORDINESS_PREMIUM_TAKES_INTO_ACCOUNT)
[uncategorized] ~335-~335: Possible missing comma found.
Context: ...ect to potentially handle dual mirrored dots which create the animation: ```cpp if...
(AI_HYDRA_LEO_MISSING_COMMA)
[uncategorized] ~345-~345: You might be missing the article “the” here.
Context: ...If color2 is not set (0), fallback to same palette color as color1. * In `rain...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[uncategorized] ~365-~365: You might be missing the article “the” here.
Context: ...pos; } ``` * The first line checks if current position has changed since last frame. ...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[grammar] ~365-~365: The verb form ‘has’ does not seem to match the subject ‘checks’.
Context: ...e first line checks if current position has changed since last frame. (Prevents ho...
(SUBJECT_VERB_AGREEMENT_PLURAL)
[uncategorized] ~365-~365: You might be missing the article “the” here.
Context: ...s if current position has changed since last frame. (Prevents holes if the dot move...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[uncategorized] ~366-~366: You might be missing the article “a” here.
Context: ....aux0) and new position (pos) to ensure smooth continuous trail. * Works in both dir...
(AI_EN_LECTOR_MISSING_DETERMINER_A)
[uncategorized] ~433-~433: Possible missing comma found.
Context: ...important one that registers the custom effect so WLED knows about it. * 255: Tempor...
(AI_HYDRA_LEO_MISSING_COMMA)
[uncategorized] ~436-~436: Loose punctuation mark.
Context: ...ction. * _data_FX_MODE_DIFFUSIONFIRE: Metadata string stored in PROGMEM, desc...
(UNLIKELY_OPENING_PUNCTUATION)
🪛 markdownlint-cli2 (0.17.2)
usermods/user_fx/README.md
25-25: Table pipe style
Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe
(MD055, table-pipe-style)
244-244: Hard tabs
Column: 12
(MD010, no-hard-tabs)
245-245: Hard tabs
Column: 5
(MD010, no-hard-tabs)
246-246: Hard tabs
Column: 5
(MD010, no-hard-tabs)
247-247: Hard tabs
Column: 5
(MD010, no-hard-tabs)
248-248: Hard tabs
Column: 5
(MD010, no-hard-tabs)
249-249: Hard tabs
Column: 5
(MD010, no-hard-tabs)
250-250: Hard tabs
Column: 12
(MD010, no-hard-tabs)
251-251: Hard tabs
Column: 5
(MD010, no-hard-tabs)
252-252: Hard tabs
Column: 5
(MD010, no-hard-tabs)
262-262: Table pipe style
Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe
(MD055, table-pipe-style)
263-263: Table pipe style
Expected: leading_and_trailing; Actual: trailing_only; Missing leading pipe
(MD055, table-pipe-style)
263-263: Table column count
Expected: 2; Actual: 1; Too few cells, row will be missing data
(MD056, table-column-count)
usermods/user_fx/README.md
Outdated
| | Syntax Element | Size | Description | | ||
| | :---------------------------------------------- | :----- | :---------- | | ||
| | `SEGMENT.intensity / speed / custom1 etc.` | 8-bit | This syntax helps define the UI sliders that can make certain elements of your running code editable by the user. (These can be controlled by the API as well.) | ||
| | `SEGENV.call / step / aux0 / aux1` | ???? | These are useful counters for you to use in your code. | | ||
| | `SEGLEN / SEG_W / SEG_H` | ??? | These variables are macros that help define the length and width of your LED strip/matrix segment. They can be changed at any time if the user sets new segment size(s). | | ||
| | `SEGCOLOR(x) / SEGPALETTE` | ??? | For user colors from UI (and how it relates to meta string) | | ||
| | `SEGMENT.color_from_palette()` | ??? | function which should be favoured over ColorFromPalette() | | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Syntax-element table is incomplete and breaks markdown-lint.
- Missing trailing pipes on every row (
MD055). - Unknown sizes marked with
???/????. SEGMENT.color_from_palette()description is mis-aligned.- The TODO comment at line 31 references functions but never follows up.
| Syntax Element | Size | Description |
| :---------------------------------------------- | :----- | :---------- |
-| `SEGMENT.intensity / speed / custom1 etc.` | 8-bit | This syntax helps define the UI sliders that can make certain elements of your running code editable by the user. (These can be controlled by the API as well.)
-| `SEGENV.call / step / aux0 / aux1` | ???? | These are useful counters for you to use in your code. |
-| `SEGLEN / SEG_W / SEG_H` | ??? | These variables are macros that help define the length and width of your LED strip/matrix segment. They can be changed at any time if the user sets new segment size(s). |
-| `SEGCOLOR(x) / SEGPALETTE` | ??? | For user colors from UI (and how it relates to meta string) |
-| `SEGMENT.color_from_palette()` | ??? | function which should be favoured over ColorFromPalette() |
+| `SEGMENT.intensity / speed / custom1 …` | 8-bit | UI-exposed parameters (sliders) available to the effect and via the JSON API. |
+| `SEGENV.call / step / aux0 / aux1` | 32-bit | Invocation counters / general-purpose scratch registers. |
+| `SEGLEN / SEG_W / SEG_H` | 16-bit | Current segment length, width and height (auto-update on segment size change). |
+| `SEGCOLOR(idx)` / `SEGPALETTE` | 24-bit | User-selected base colors and palette index. |
+| `SEGMENT.color_from_palette()` | — | Helper that prefers the active palette; use this instead of `ColorFromPalette()`. |Follow-up: after fixing the table, replace line 31 with an actual list of helper functions or drop the sentence entirely.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| | Syntax Element | Size | Description | | |
| | :---------------------------------------------- | :----- | :---------- | | |
| | `SEGMENT.intensity / speed / custom1 etc.` | 8-bit | This syntax helps define the UI sliders that can make certain elements of your running code editable by the user. (These can be controlled by the API as well.) | |
| | `SEGENV.call / step / aux0 / aux1` | ???? | These are useful counters for you to use in your code. | | |
| | `SEGLEN / SEG_W / SEG_H` | ??? | These variables are macros that help define the length and width of your LED strip/matrix segment. They can be changed at any time if the user sets new segment size(s). | | |
| | `SEGCOLOR(x) / SEGPALETTE` | ??? | For user colors from UI (and how it relates to meta string) | | |
| | `SEGMENT.color_from_palette()` | ??? | function which should be favoured over ColorFromPalette() | | |
| | Syntax Element | Size | Description | | |
| | :---------------------------------------------- | :----- | :---------- | | |
| | `SEGMENT.intensity / speed / custom1 …` | 8-bit | UI-exposed parameters (sliders) available to the effect and via the JSON API. | | |
| | `SEGENV.call / step / aux0 / aux1` | 32-bit | Invocation counters / general-purpose scratch registers. | | |
| | `SEGLEN / SEG_W / SEG_H` | 16-bit | Current segment length, width and height (auto-update on segment size change). | | |
| | `SEGCOLOR(idx)` / `SEGPALETTE` | 24-bit | User-selected base colors and palette index. | | |
| | `SEGMENT.color_from_palette()` | — | Helper that prefers the active palette; use this instead of `ColorFromPalette()`. | |
🧰 Tools
🪛 LanguageTool
[uncategorized] ~27-~27: You might be missing the article “a” here.
Context: ...be changed at any time if the user sets new segment size(s). | | `SEGCOLOR(x) / SE...
(AI_EN_LECTOR_MISSING_DETERMINER_A)
🪛 markdownlint-cli2 (0.17.2)
25-25: Table pipe style
Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe
(MD055, table-pipe-style)
🤖 Prompt for AI Agents
In usermods/user_fx/README.md lines 23 to 30, fix the markdown table by adding
missing trailing pipes at the end of each row to comply with markdown-lint
MD055. Replace the unknown size placeholders (???/????) with the correct sizes
or appropriate descriptions. Align the description of
SEGMENT.color_from_palette() properly with the other rows. After fixing the
table, update line 31 by either adding a list of helper functions as referenced
or remove the TODO comment entirely if no list is available.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (1)
usermods/user_fx/README.md (1)
23-30: Fix the “Basic Syntax” table – wrong sizes, missing pipes, placeholder markers.The first content table violates MD055 (missing trailing pipes) and still contains
???placeholders.
Tighten it up and supply the actual widths so readers are not left guessing.-| `SEGENV.call / step / aux0 / aux1` | ???? | These are useful counters for you to use in your code. | -| `SEGLEN / SEG_W / SEG_H` | ??? | These variables are macros that help define the length and width of your LED strip/matrix segment. They can be changed at any time if the user sets new segment size(s). | -| `SEGCOLOR(x) / SEGPALETTE` | ??? | For user colors from UI (and how it relates to meta string) | -| `SEGMENT.color_from_palette()` | ??? | function which should be favoured over ColorFromPalette() | +| `SEGENV.call / step / aux0 / aux1` | 32-bit | Invocation counters and scratch registers that persist across frames. | +| `SEGLEN / SEG_W / SEG_H` | 16-bit | Current logical length / width / height of the active segment (auto-updated when the user resizes the segment). | +| `SEGCOLOR(idx)` / `SEGPALETTE` | 24-bit | User-selectable base colours (`SEGCOLOR`) and active palette index (`SEGPALETTE`). | +| `SEGMENT.color_from_palette()` | – | Preferred helper for palette look-ups; wraps `ColorFromPalette()` and respects segment options. |Make sure every row ends with a trailing
|so markdown-lint stops complaining.
🧹 Nitpick comments (2)
usermods/user_fx/README.md (2)
3-3: Spell-check & micro-grammar pass needed.A quick sweep spots several typos that slip through the doc:
depracated→deprecated(l. 3)abour→about(l. 15)fo code→for code(l. 135)tep by step→step by step(l. 274)taked into account→takes into account(l. 315)speicfy→specify(l. 398)instatiation→instantiation(l. 437)offical→official(l. 456)Cleaning these up will improve professionalism and searchability.
Also applies to: 15-15, 135-135, 274-274, 315-315, 398-398, 437-437, 456-456
244-252: Replace hard tabs with spaces in the parameter table.Lines 244-252 contain tab characters, triggering MD010 and breaking alignment in some editors. Convert them to single spaces (normal markdown tables don’t need perfect column alignment).
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
usermods/user_fx/README.md(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: willmmiles
PR: wled/WLED#4623
File: usermods/word-clock-matrix/word-clock-matrix.cpp:332-332
Timestamp: 2025-03-29T01:22:54.617Z
Learning: In the WLED project, hardcoded usermod IDs (like 500 in the WordClockMatrix's getId() method) are intentionally used as part of a strategy to avoid modifying core code. There are plans to remove numeric usermod IDs entirely in the future.
Learnt from: netmindz
PR: wled/WLED#4728
File: wled00/FX.h:378-378
Timestamp: 2025-06-15T09:59:52.720Z
Learning: In WLED's FX.h, MODE_COUNT represents the highest FX_MODE_ ID + 1, not the total count of FX_MODE_ definitions. This is because some effects may have been removed but their IDs are not reused, creating gaps in the numbering sequence. MODE_COUNT is used for array bounds and range checking.
Learnt from: netmindz
PR: wled/WLED#4728
File: wled00/FX.h:378-378
Timestamp: 2025-06-15T09:59:52.720Z
Learning: In WLED's FX.h, MODE_COUNT represents the highest FX_MODE_ ID + 1, not the total count of FX_MODE_ definitions. This is because some effects may have been removed but their IDs are not reused, creating gaps in the numbering sequence. MODE_COUNT is used for array bounds and range checking.
Learnt from: KrX3D
PR: wled/WLED#4237
File: usermods/INA219_v2/INA219_v2.cpp:265-276
Timestamp: 2025-04-18T22:27:58.634Z
Learning: When implementing MQTT message handling in WLED usermods, use `strstr(topic, "/specific/path")` instead of `strcmp_P(topic, PSTR("/specific/path"))` to properly match topics that include the device prefix. The full MQTT topic typically follows the pattern `<mqttDeviceTopic>/specific/path`.
Learnt from: DedeHai
PR: wled/WLED#4750
File: usermods/audioreactive/audio_reactive.cpp:311-321
Timestamp: 2025-06-27T06:04:44.652Z
Learning: In WLED's AudioReactive usermod, FFT buffer memory (valFFT, windowFFT) is allocated once during initialization and never deallocated, following typical embedded system design where core functionality buffers persist for the application lifetime. Raw buffer pointers for aligned allocations don't need to be tracked in the current implementation since deallocation is never performed.
usermods/user_fx/README.md (8)
Learnt from: netmindz
PR: wled/WLED#4728
File: wled00/FX.h:378-378
Timestamp: 2025-06-15T09:59:52.720Z
Learning: In WLED's FX.h, MODE_COUNT represents the highest FX_MODE_ ID + 1, not the total count of FX_MODE_ definitions. This is because some effects may have been removed but their IDs are not reused, creating gaps in the numbering sequence. MODE_COUNT is used for array bounds and range checking.
Learnt from: netmindz
PR: wled/WLED#4728
File: wled00/FX.h:378-378
Timestamp: 2025-06-15T09:59:52.720Z
Learning: In WLED's FX.h, MODE_COUNT represents the highest FX_MODE_ ID + 1, not the total count of FX_MODE_ definitions. This is because some effects may have been removed but their IDs are not reused, creating gaps in the numbering sequence. MODE_COUNT is used for array bounds and range checking.
Learnt from: willmmiles
PR: wled/WLED#4623
File: usermods/word-clock-matrix/word-clock-matrix.cpp:332-332
Timestamp: 2025-03-29T01:22:54.617Z
Learning: In the WLED project, hardcoded usermod IDs (like 500 in the WordClockMatrix's getId() method) are intentionally used as part of a strategy to avoid modifying core code. There are plans to remove numeric usermod IDs entirely in the future.
Learnt from: DedeHai
PR: wled/WLED#4750
File: usermods/audioreactive/audio_reactive.cpp:311-321
Timestamp: 2025-06-27T06:04:44.652Z
Learning: In WLED's AudioReactive usermod, FFT buffer memory (valFFT, windowFFT) is allocated once during initialization and never deallocated, following typical embedded system design where core functionality buffers persist for the application lifetime. Raw buffer pointers for aligned allocations don't need to be tracked in the current implementation since deallocation is never performed.
Learnt from: KrX3D
PR: wled/WLED#4237
File: usermods/INA219_v2/INA219_v2.cpp:265-276
Timestamp: 2025-04-18T22:27:58.634Z
Learning: When implementing MQTT message handling in WLED usermods, use `strstr(topic, "/specific/path")` instead of `strcmp_P(topic, PSTR("/specific/path"))` to properly match topics that include the device prefix. The full MQTT topic typically follows the pattern `<mqttDeviceTopic>/specific/path`.
Learnt from: DedeHai
PR: wled/WLED#4682
File: wled00/FX.cpp:9016-9039
Timestamp: 2025-05-09T18:48:21.296Z
Learning: WLED does not support matrices large enough (≥1024 px) for 32-bit overflow in dx*dx + dy*dy to be a practical concern in particle system effects.
Learnt from: blazoncek
PR: wled/WLED#4667
File: usermods/user_fx/user_fx.cpp:27-30
Timestamp: 2025-04-30T05:41:03.633Z
Learning: In WLED, the Segment::allocateData() method already includes optimization to check if data is allocated and sufficiently sized, handling buffer reuse to reduce memory fragmentation. Adding an external check like `if (SEGENV.data == nullptr && !SEGENV.allocateData(dataSize))` is unnecessary and could be problematic, as it bypasses proper size verification.
Learnt from: willmmiles
PR: wled/WLED#4712
File: wled00/FX_fcn.cpp:992-993
Timestamp: 2025-06-07T15:58:42.579Z
Learning: In WLED segments, the backing pixel buffer is always allocated to the full physical segment size, but effect rendering only uses a subset when mirror or grouping are enabled. For 2D segments, this subset is vWidth() * vHeight(), and for 1D segments it's vLength(). Color processing operations like fade_out should iterate over this rendering subset, not the full allocated buffer.
🪛 LanguageTool
usermods/user_fx/README.md
[style] ~13-~13: Consider removing “of” to be more concise
Context: ...area is where you place the FX code for all of the custom effects you want to use. This m...
(ALL_OF_THE)
[style] ~15-~15: As a shorter alternative for ‘able to’, consider using “can”.
Context: ...mods have to be registered so that they are able to be compiled into your binary. We will ...
(BE_ABLE_TO)
[style] ~15-~15: Avoid the passive voice after ‘to be able to’.
Context: ... be registered so that they are able to be compiled into your binary. We will go into grea...
(ABLE_TO_PASSIVE)
[uncategorized] ~27-~27: You might be missing the article “a” here.
Context: ...be changed at any time if the user sets new segment size(s). | | `SEGCOLOR(x) / SE...
(AI_EN_LECTOR_MISSING_DETERMINER_A)
[typographical] ~36-~36: It appears that a comma is missing.
Context: ... Understanding 2D WLED Effects In this section we give some advice to those who are ne...
(DURING_THAT_TIME_COMMA)
[uncategorized] ~40-~40: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...le. This file handles all other imports and it has all the global variable declarat...
(COMMA_COMPOUND_SENTENCE)
[uncategorized] ~57-~57: Possible missing comma found.
Context: ...lock contains several constant variable definitions which essentially serve to extract the ...
(AI_HYDRA_LEO_MISSING_COMMA)
[misspelling] ~78-~78: Nonstandard phrase. Did you mean: “from 0 to 255”?
Context: ...MENT.speed (user-controllable parameter from 0–255) to a value between 20 and 80 Hz. * T...
(FROM_X_Y)
[uncategorized] ~80-~80: Possible missing comma found.
Context: ...gher speed = more frames per second). * Next we convert refresh rate from Hz to mill...
(AI_HYDRA_LEO_MISSING_COMMA)
[uncategorized] ~80-~80: You might be missing the article “the” here.
Context: ...e frames per second). * Next we convert refresh rate from Hz to milliseconds. (It’s eas...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[uncategorized] ~84-~84: Possible missing comma found.
Context: ...re diffusion = smoother flame spread. * Next we assign SEGMENT.intensity (user inp...
(AI_HYDRA_LEO_MISSING_COMMA)
[uncategorized] ~106-~106: You might be missing the article “the” here.
Context: ...nd the effect can’t proceed. * It calls previously defined mode_static() fallback effect...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[uncategorized] ~135-~135: The preposition “of” seems more likely in this position.
Context: ...conditional statement in the first line fo code ensures the effect updates on a fi...
(AI_EN_LECTOR_REPLACEMENT_PREPOSITION)
[uncategorized] ~153-~153: Possible missing preposition found.
Context: ...whether we even attempt to spawn sparks this frame. * hw_random8() gives another...
(AI_HYDRA_LEO_MISSING_IN)
[uncategorized] ~184-~184: Possible missing article found.
Context: ...Starting with the current heat value of pixel (x, y) assigned v: * if there’s a p...
(AI_HYDRA_LEO_MISSING_A)
[uncategorized] ~209-~209: Possible missing comma found.
Context: ... color-rendering for each pixel row.) * Next we update the main segment data with th...
(AI_HYDRA_LEO_MISSING_COMMA)
[grammar] ~211-~211: Use the plural noun “” with the number ‘255’.
Context: ...olor` from the current palette with 255 brightness, and no wrapping in palette lookup. *...
(IN_CD_PUNCTUATION)
[typographical] ~213-~213: Consider adding a comma after ‘Finally’ for more clarity.
Context: ... flames (e.g., yellow → red → black). * Finally we set the rendered color for the pixel...
(RB_LY_COMMA)
[grammar] ~215-~215: The word “fallback” is a noun. The verb is spelled with a space.
Context: ...h row. * If palette use is disabled, we fallback to fading a base color. * SEGCOLOR(0)...
(NOUN_VERB_CONFUSION)
[grammar] ~236-~236: Did you mean the adverb/preposition “within”?
Context: ...ines how the effect is to be interacted with in the UI: ```cpp static const char data...
(WITH_IN)
[typographical] ~262-~262: The word “otherwise” is an adverb that can’t be used like a conjunction, and therefore needs to be separated from the sentence.
Context: ...ffect uses a palette (ColorFromPalette()), otherwise it fades from SEGCOLOR(0). The first s...
(THUS_SENTENCE)
[style] ~264-~264: ‘in conjunction with’ might be wordy. Consider a shorter alternative.
Context: ...s to be selected by the user. But used in conjunction with the checkbox argument, palette use can ...
(EN_WORDINESS_PREMIUM_IN_CONJUNCTION_WITH)
[uncategorized] ~280-~280: You might be missing the article “a” here.
Context: ... line of code defines sinelon base as static helper function. This is how all effec...
(AI_EN_LECTOR_MISSING_DETERMINER_A)
[uncategorized] ~312-~312: Loose punctuation mark.
Context: ...2_t color2 = SEGCOLOR(2); ``` * color1: main moving dot color, chosen from pale...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~312-~312: You might be missing the article “a” here.
Context: ...r1`: main moving dot color, chosen from palette using the current position as index. * ...
(AI_EN_LECTOR_MISSING_DETERMINER_A)
[uncategorized] ~313-~313: Loose punctuation mark.
Context: ...he current position as index. * color2: secondary color from user-configured co...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~315-~315: This word is normally spelled with a hyphen.
Context: ... account the optional argument for if a Rainbow colored palette is in use: ```cpp if (rainbow...
(RAINBOW_COLORED)
[style] ~329-~329: ‘takes into account’ might be wordy. Consider a shorter alternative.
Context: ...with the selected color. The next line takes into account another one of the optional arguments f...
(EN_WORDINESS_PREMIUM_TAKES_INTO_ACCOUNT)
[uncategorized] ~329-~329: Possible missing comma found.
Context: ...ect to potentially handle dual mirrored dots which create the animation: ```cpp if...
(AI_HYDRA_LEO_MISSING_COMMA)
[uncategorized] ~339-~339: You might be missing the article “the” here.
Context: ...If color2 is not set (0), fallback to same palette color as color1. * In `rain...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[uncategorized] ~359-~359: You might be missing the article “the” here.
Context: ...pos; } ``` * The first line checks if current position has changed since last frame. ...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[grammar] ~359-~359: The verb form ‘has’ does not seem to match the subject ‘checks’.
Context: ...e first line checks if current position has changed since last frame. (Prevents ho...
(SUBJECT_VERB_AGREEMENT_PLURAL)
[uncategorized] ~359-~359: You might be missing the article “the” here.
Context: ...s if current position has changed since last frame. (Prevents holes if the dot move...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[uncategorized] ~360-~360: You might be missing the article “a” here.
Context: ....aux0) and new position (pos) to ensure smooth continuous trail. * Works in both dir...
(AI_EN_LECTOR_MISSING_DETERMINER_A)
[uncategorized] ~427-~427: Possible missing comma found.
Context: ...important one that registers the custom effect so WLED knows about it. * 255: Tempor...
(AI_HYDRA_LEO_MISSING_COMMA)
[uncategorized] ~430-~430: Loose punctuation mark.
Context: ...ction. * _data_FX_MODE_DIFFUSIONFIRE: Metadata string stored in PROGMEM, desc...
(UNLIKELY_OPENING_PUNCTUATION)
🪛 markdownlint-cli2 (0.17.2)
usermods/user_fx/README.md
25-25: Table pipe style
Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe
(MD055, table-pipe-style)
244-244: Hard tabs
Column: 12
(MD010, no-hard-tabs)
245-245: Hard tabs
Column: 5
(MD010, no-hard-tabs)
246-246: Hard tabs
Column: 5
(MD010, no-hard-tabs)
247-247: Hard tabs
Column: 5
(MD010, no-hard-tabs)
248-248: Hard tabs
Column: 5
(MD010, no-hard-tabs)
249-249: Hard tabs
Column: 5
(MD010, no-hard-tabs)
250-250: Hard tabs
Column: 12
(MD010, no-hard-tabs)
251-251: Hard tabs
Column: 5
(MD010, no-hard-tabs)
252-252: Hard tabs
Column: 5
(MD010, no-hard-tabs)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (2)
usermods/user_fx/README.md (2)
38-40: Remove or complete the lingering TODO paragraphThe sentence beginning with “explaining available functions for pixel drawing …” is an obvious placeholder and renders the doc unfinished. Either delete the line or expand it into a proper subsection that lists helpers like
move(),blur(),fade_out(),sparkle(), etc.
30-36: Fix broken Markdown table and replace placeholder???values
markdownlintis still flagging MD055 because the rows don’t have closing pipes, and the???placeholders make the information unreliable for readers.Suggested patch:
-| Syntax Element | Size | Description | -| :---------------------------------------------- | :----- | :---------- | -| `SEGMENT.intensity / speed / custom1 etc.` | 8-bit | This syntax helps define the UI sliders that can make certain elements of your running code editable by the user. (These can be controlled by the API as well.) -| `SEGENV.call / step / aux0 / aux1` | ???? | These are useful counters for you to use in your code. | -| `SEGLEN / SEG_W / SEG_H` | ??? | These variables are macros that help define the length and width of your LED strip/matrix segment. They can be changed at any time if the user sets new segment size(s). | -| `SEGCOLOR(x) / SEGPALETTE` | ??? | For user colors from UI (and how it relates to meta string) | -| `SEGMENT.color_from_palette()` | ??? | function which should be favoured over ColorFromPalette() | +| Syntax Element | Size | Description | +| :------------- | :--- | :---------- | +| `SEGMENT.intensity`, `SEGMENT.speed`, `SEGMENT.custom1-3` | 8-bit | UI-exposed sliders/knobs available in the JSON API | +| `SEGENV.call`, `SEGENV.step`, `SEGENV.aux0/aux1` | 32-bit | Frame counters / scratch registers for effect state | +| `SEGLEN`, `SEG_W`, `SEG_H` | 16-bit | Current segment length, width and height | +| `SEGCOLOR(n)` | 24-bit | User-selected base colors (RGB) | +| `SEGPALETTE` | 8-bit | Index of the active palette | +| `SEGMENT.color_from_palette()` | — | Helper that blends a palette colour (preferred over `ColorFromPalette()`) |
🧹 Nitpick comments (2)
usermods/user_fx/README.md (2)
3-6: Typos and minor grammar glitchesA quick sweep catches several small mistakes that slip past spell-check:
- “depracated” ➜ deprecated (l 3)
- “abour” ➜ about (l 17)
- “tep by step” ➜ step by step (l 285)
- “taked into account” ➜ takes into account (l 300)
- “wanted add” ➜ wanted to add (l 462)
- “different than” ➜ different from (l 464)
- “Compiling Compiling” duplicate word (l 469)
Worth fixing while you’re touching the file.
Also applies to: 17-18, 285-300, 462-465, 469-470
145-147: Minor wording: “fo code” typo and missing article
the conditional statement in the first line fo code→ of the code.
Not critical, but easy to tidy during the next pass.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
usermods/user_fx/README.md(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: willmmiles
PR: wled/WLED#4623
File: usermods/word-clock-matrix/word-clock-matrix.cpp:332-332
Timestamp: 2025-03-29T01:22:54.617Z
Learning: In the WLED project, hardcoded usermod IDs (like 500 in the WordClockMatrix's getId() method) are intentionally used as part of a strategy to avoid modifying core code. There are plans to remove numeric usermod IDs entirely in the future.
Learnt from: netmindz
PR: wled/WLED#4728
File: wled00/FX.h:378-378
Timestamp: 2025-06-15T09:59:52.720Z
Learning: In WLED's FX.h, MODE_COUNT represents the highest FX_MODE_ ID + 1, not the total count of FX_MODE_ definitions. This is because some effects may have been removed but their IDs are not reused, creating gaps in the numbering sequence. MODE_COUNT is used for array bounds and range checking.
Learnt from: netmindz
PR: wled/WLED#4728
File: wled00/FX.h:378-378
Timestamp: 2025-06-15T09:59:52.720Z
Learning: In WLED's FX.h, MODE_COUNT represents the highest FX_MODE_ ID + 1, not the total count of FX_MODE_ definitions. This is because some effects may have been removed but their IDs are not reused, creating gaps in the numbering sequence. MODE_COUNT is used for array bounds and range checking.
Learnt from: KrX3D
PR: wled/WLED#4237
File: usermods/INA219_v2/INA219_v2.cpp:265-276
Timestamp: 2025-04-18T22:27:58.634Z
Learning: When implementing MQTT message handling in WLED usermods, use `strstr(topic, "/specific/path")` instead of `strcmp_P(topic, PSTR("/specific/path"))` to properly match topics that include the device prefix. The full MQTT topic typically follows the pattern `<mqttDeviceTopic>/specific/path`.
usermods/user_fx/README.md (7)
Learnt from: netmindz
PR: wled/WLED#4728
File: wled00/FX.h:378-378
Timestamp: 2025-06-15T09:59:52.720Z
Learning: In WLED's FX.h, MODE_COUNT represents the highest FX_MODE_ ID + 1, not the total count of FX_MODE_ definitions. This is because some effects may have been removed but their IDs are not reused, creating gaps in the numbering sequence. MODE_COUNT is used for array bounds and range checking.
Learnt from: netmindz
PR: wled/WLED#4728
File: wled00/FX.h:378-378
Timestamp: 2025-06-15T09:59:52.720Z
Learning: In WLED's FX.h, MODE_COUNT represents the highest FX_MODE_ ID + 1, not the total count of FX_MODE_ definitions. This is because some effects may have been removed but their IDs are not reused, creating gaps in the numbering sequence. MODE_COUNT is used for array bounds and range checking.
Learnt from: willmmiles
PR: wled/WLED#4623
File: usermods/word-clock-matrix/word-clock-matrix.cpp:332-332
Timestamp: 2025-03-29T01:22:54.617Z
Learning: In the WLED project, hardcoded usermod IDs (like 500 in the WordClockMatrix's getId() method) are intentionally used as part of a strategy to avoid modifying core code. There are plans to remove numeric usermod IDs entirely in the future.
Learnt from: KrX3D
PR: wled/WLED#4237
File: usermods/INA219_v2/INA219_v2.cpp:265-276
Timestamp: 2025-04-18T22:27:58.634Z
Learning: When implementing MQTT message handling in WLED usermods, use `strstr(topic, "/specific/path")` instead of `strcmp_P(topic, PSTR("/specific/path"))` to properly match topics that include the device prefix. The full MQTT topic typically follows the pattern `<mqttDeviceTopic>/specific/path`.
Learnt from: DedeHai
PR: wled/WLED#4682
File: wled00/FX.cpp:9016-9039
Timestamp: 2025-05-09T18:48:21.296Z
Learning: WLED does not support matrices large enough (≥1024 px) for 32-bit overflow in dx*dx + dy*dy to be a practical concern in particle system effects.
Learnt from: blazoncek
PR: wled/WLED#4667
File: usermods/user_fx/user_fx.cpp:27-30
Timestamp: 2025-04-30T05:41:03.633Z
Learning: In WLED, the Segment::allocateData() method already includes optimization to check if data is allocated and sufficiently sized, handling buffer reuse to reduce memory fragmentation. Adding an external check like `if (SEGENV.data == nullptr && !SEGENV.allocateData(dataSize))` is unnecessary and could be problematic, as it bypasses proper size verification.
Learnt from: willmmiles
PR: wled/WLED#4712
File: wled00/FX_fcn.cpp:992-993
Timestamp: 2025-06-07T15:58:42.579Z
Learning: In WLED segments, the backing pixel buffer is always allocated to the full physical segment size, but effect rendering only uses a subset when mirror or grouping are enabled. For 2D segments, this subset is vWidth() * vHeight(), and for 1D segments it's vLength(). Color processing operations like fade_out should iterate over this rendering subset, not the full allocated buffer.
🪛 LanguageTool
usermods/user_fx/README.md
[style] ~13-~13: Consider removing “of” to be more concise
Context: ...area is where you place the FX code for all of the custom effects you want to use. This m...
(ALL_OF_THE)
[style] ~15-~15: As a shorter alternative for ‘able to’, consider using “can”.
Context: ...mods have to be registered so that they are able to be compiled into your binary. We will ...
(BE_ABLE_TO)
[style] ~15-~15: Avoid the passive voice after ‘to be able to’.
Context: ... be registered so that they are able to be compiled into your binary. We will go into grea...
(ABLE_TO_PASSIVE)
[uncategorized] ~26-~26: You might be missing the article “the” here.
Context: ...elColor()` 4. The function is called at current frame rate. Below are some helpful var...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[uncategorized] ~34-~34: You might be missing the article “a” here.
Context: ...be changed at any time if the user sets new segment size(s). | | `SEGCOLOR(x) / SE...
(AI_EN_LECTOR_MISSING_DETERMINER_A)
[uncategorized] ~39-~39: Possible missing comma found.
Context: ...eally true anymore with segment layering but not doing so may still result in glitch...
(AI_HYDRA_LEO_MISSING_COMMA)
[typographical] ~46-~46: It appears that a comma is missing.
Context: ... Understanding 2D WLED Effects In this section we give some advice to those who are ne...
(DURING_THAT_TIME_COMMA)
[uncategorized] ~50-~50: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...le. This file handles all other imports and it has all the global variable declarat...
(COMMA_COMPOUND_SENTENCE)
[uncategorized] ~67-~67: Possible missing comma found.
Context: ...lock contains several constant variable definitions which essentially serve to extract the ...
(AI_HYDRA_LEO_MISSING_COMMA)
[misspelling] ~88-~88: Nonstandard phrase. Did you mean: “from 0 to 255”?
Context: ...MENT.speed (user-controllable parameter from 0–255) to a value between 20 and 80 Hz. * T...
(FROM_X_Y)
[uncategorized] ~90-~90: Possible missing comma found.
Context: ...gher speed = more frames per second). * Next we convert refresh rate from Hz to mill...
(AI_HYDRA_LEO_MISSING_COMMA)
[uncategorized] ~90-~90: You might be missing the article “the” here.
Context: ...e frames per second). * Next we convert refresh rate from Hz to milliseconds. (It’s eas...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[uncategorized] ~94-~94: Possible missing comma found.
Context: ...re diffusion = smoother flame spread. * Next we assign SEGMENT.intensity (user inp...
(AI_HYDRA_LEO_MISSING_COMMA)
[uncategorized] ~116-~116: You might be missing the article “the” here.
Context: ...nd the effect can’t proceed. * It calls previously defined mode_static() fallback effect...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[uncategorized] ~145-~145: The preposition “of” seems more likely in this position.
Context: ...conditional statement in the first line fo code ensures the effect updates on a fi...
(AI_EN_LECTOR_REPLACEMENT_PREPOSITION)
[uncategorized] ~163-~163: Possible missing preposition found.
Context: ...whether we even attempt to spawn sparks this frame. * hw_random8() gives another...
(AI_HYDRA_LEO_MISSING_IN)
[uncategorized] ~194-~194: Possible missing article found.
Context: ...Starting with the current heat value of pixel (x, y) assigned v: * if there’s a p...
(AI_HYDRA_LEO_MISSING_A)
[uncategorized] ~219-~219: Possible missing comma found.
Context: ... color-rendering for each pixel row.) * Next we update the main segment data with th...
(AI_HYDRA_LEO_MISSING_COMMA)
[grammar] ~221-~221: Use the plural noun “” with the number ‘255’.
Context: ...olor` from the current palette with 255 brightness, and no wrapping in palette lookup. *...
(IN_CD_PUNCTUATION)
[typographical] ~223-~223: Consider adding a comma after ‘Finally’ for more clarity.
Context: ... flames (e.g., yellow → red → black). * Finally we set the rendered color for the pixel...
(RB_LY_COMMA)
[grammar] ~225-~225: The word “fallback” is a noun. The verb is spelled with a space.
Context: ...h row. * If palette use is disabled, we fallback to fading a base color. * SEGCOLOR(0)...
(NOUN_VERB_CONFUSION)
[grammar] ~246-~246: Did you mean the adverb/preposition “within”?
Context: ...ines how the effect is to be interacted with in the UI: ```cpp static const char data...
(WITH_IN)
[typographical] ~273-~273: The word “otherwise” is an adverb that can’t be used like a conjunction, and therefore needs to be separated from the sentence.
Context: ...s is enabled, the effect uses a palette ColorFromPalette(), otherwise it fades from SEGCOLOR(0). The first...
(THUS_SENTENCE)
[style] ~275-~275: ‘in conjunction with’ might be wordy. Consider a shorter alternative.
Context: ...s to be selected by the user. But used in conjunction with the checkbox argument, palette use can ...
(EN_WORDINESS_PREMIUM_IN_CONJUNCTION_WITH)
[uncategorized] ~291-~291: You might be missing the article “a” here.
Context: ... line of code defines sinelon base as static helper function. This is how all effec...
(AI_EN_LECTOR_MISSING_DETERMINER_A)
[uncategorized] ~323-~323: Loose punctuation mark.
Context: ...2_t color2 = SEGCOLOR(2); ``` * color1: main moving dot color, chosen from pale...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~323-~323: You might be missing the article “a” here.
Context: ...r1`: main moving dot color, chosen from palette using the current position as index. * ...
(AI_EN_LECTOR_MISSING_DETERMINER_A)
[uncategorized] ~324-~324: Loose punctuation mark.
Context: ...he current position as index. * color2: secondary color from user-configured co...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~326-~326: This word is normally spelled with a hyphen.
Context: ... account the optional argument for if a Rainbow colored palette is in use: ```cpp if (rainbow...
(RAINBOW_COLORED)
[style] ~340-~340: ‘takes into account’ might be wordy. Consider a shorter alternative.
Context: ...with the selected color. The next line takes into account another one of the optional arguments f...
(EN_WORDINESS_PREMIUM_TAKES_INTO_ACCOUNT)
[uncategorized] ~340-~340: Possible missing comma found.
Context: ...ect to potentially handle dual mirrored dots which create the animation: ```cpp if...
(AI_HYDRA_LEO_MISSING_COMMA)
[uncategorized] ~350-~350: You might be missing the article “the” here.
Context: ...If color2 is not set (0), fallback to same palette color as color1. * In `rain...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[uncategorized] ~370-~370: You might be missing the article “the” here.
Context: ...pos; } ``` * The first line checks if current position has changed since last frame. ...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[grammar] ~370-~370: The verb form ‘has’ does not seem to match the subject ‘checks’.
Context: ...e first line checks if current position has changed since last frame. (Prevents ho...
(SUBJECT_VERB_AGREEMENT_PLURAL)
[uncategorized] ~370-~370: You might be missing the article “the” here.
Context: ...s if current position has changed since last frame. (Prevents holes if the dot move...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[uncategorized] ~371-~371: You might be missing the article “a” here.
Context: ....aux0) and new position (pos) to ensure smooth continuous trail. * Works in both dir...
(AI_EN_LECTOR_MISSING_DETERMINER_A)
[uncategorized] ~439-~439: Possible missing comma found.
Context: ...important one that registers the custom effect so WLED knows about it. * 255: Tempor...
(AI_HYDRA_LEO_MISSING_COMMA)
[uncategorized] ~442-~442: Loose punctuation mark.
Context: ...ction. * _data_FX_MODE_DIFFUSIONFIRE: Metadata string stored in PROGMEM, desc...
(UNLIKELY_OPENING_PUNCTUATION)
[grammar] ~462-~462: The verb “add” needs to be in the to-infinitive form.
Context: ...this Usermod So now let's say that you wanted add the effects "Diffusion Fire" and "Sine...
(MISSING_TO_BEFORE_A_VERB)
[style] ~464-~464: Did you mean ‘different from’? ‘Different than’ is often considered colloquial style.
Context: ...ell--and to name it something different than what's already inside the core WLED cod...
(DIFFERENT_THAN)
[duplication] ~469-~469: Possible typo: you repeated a word.
Context: ... Usermod class. * Compile the code! ## Compiling Compiling WLED yourself is beyond the scope of th...
(ENGLISH_WORD_REPEAT_RULE)
🪛 markdownlint-cli2 (0.17.2)
usermods/user_fx/README.md
32-32: Table pipe style
Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe
(MD055, table-pipe-style)
254-254: Hard tabs
Column: 12
(MD010, no-hard-tabs)
256-256: Hard tabs
Column: 5
(MD010, no-hard-tabs)
257-257: Hard tabs
Column: 5
(MD010, no-hard-tabs)
258-258: Hard tabs
Column: 5
(MD010, no-hard-tabs)
259-259: Hard tabs
Column: 5
(MD010, no-hard-tabs)
260-260: Hard tabs
Column: 5
(MD010, no-hard-tabs)
261-261: Hard tabs
Column: 12
(MD010, no-hard-tabs)
262-262: Hard tabs
Column: 5
(MD010, no-hard-tabs)
263-263: Hard tabs
Column: 5
(MD010, no-hard-tabs)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (2)
usermods/user_fx/README.md (2)
43-45: Placeholder about pixel-drawing helpers still presentThe sentence starting “explaining available functions for pixel drawing…” is a TODO from earlier revisions. Either list the helpers (
move(),blur(),fade_out(),fill(), etc.) with short explanations, or delete the line to keep the README publication-ready.
30-42: Table still malformed & carries unknown placeholders – please finalise and lintThe core “Basic Syntax” table is still failing MD055 (missing trailing pipes) and contains
???/????placeholders plus two rows with empty size/description cells. This undermines credibility and blocks successful markdown-lint runs.Suggested fix (replace entire table block):
-| Syntax Element | Size | Description | -| :---------------------------------------------- | :----- | :---------- | -| `SEGMENT.intensity / speed / custom1 etc.` | 8-bit | UI-exposed parameters (sliders) available to the effect and via JSON API | -| `SEGENV.aux0` | ???? | A temporary state variable to keep track of last position. (how does this relate to aux1?) | -| `SEGENV.call` | | A counter for how many times this effect function has been invoked since it started. | -| `strip.now` | | Current timestamp in milliseconds. | -| `SEGLEN / SEG_W / SEG_H` | ??? | These variables are macros that help define the length and width of your LED strip/matrix segment. They can be changed at any time if the user sets new segment size(s). | -| `SEGCOLOR(x)` | ??? | Gets user-selected colors from UI, where x is an integer 1, 2, or 3 fr primary, secondary, and tertiary colors, respectively. (and how it relates to meta string??) | -| `SEGMENT.setPixelColor` | | | -| `SEGPALETTE` | | | -| `SEGMENT.color_from_palette()` | ??? | Easy way to specify a Palette. This function which should be favoured over `ColorFromPalette()`. | -| `hw_random8()` | 8-bit | Generates a random integer. | +| Syntax Element | Size | Description | +| :----------------------------------- | :----- | :---------- | +| `SEGMENT.intensity / speed / customX`| 8-bit | UI-controlled parameters exposed as sliders (`sx`, `ix`, `c1…c3`) | +| `SEGENV.aux0 / aux1` | 16-bit | Scratch registers for per-segment state between frames | +| `SEGENV.call` | 32-bit | Invocation counter since effect start | +| `strip.now` | 32-bit | Current millis timestamp | +| `SEGLEN`, `SEG_W`, `SEG_H` | 16-bit | Virtual length / width / height of the segment after mirroring & grouping | +| `SEGCOLOR(idx)` | 24-bit | User-selected color slot (`idx` 0-2) | +| `SEGMENT.setPixelColor()` / `setPixelColorXY()`| — | Write RGB to a 1-D or 2-D coordinate | +| `SEGPALETTE` | 8-bit | Currently selected palette ID | +| `SEGMENT.color_from_palette()` | 24-bit | Helper that samples the active palette with blending | +| `hw_random8()` | 8-bit | Hardware RNG helper |This removes unknown sizes, adds missing descriptions, and includes trailing pipes to satisfy linting.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
usermods/user_fx/README.md(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: willmmiles
PR: wled/WLED#4623
File: usermods/word-clock-matrix/word-clock-matrix.cpp:332-332
Timestamp: 2025-03-29T01:22:54.617Z
Learning: In the WLED project, hardcoded usermod IDs (like 500 in the WordClockMatrix's getId() method) are intentionally used as part of a strategy to avoid modifying core code. There are plans to remove numeric usermod IDs entirely in the future.
Learnt from: netmindz
PR: wled/WLED#4728
File: wled00/FX.h:378-378
Timestamp: 2025-06-15T09:59:52.720Z
Learning: In WLED's FX.h, MODE_COUNT represents the highest FX_MODE_ ID + 1, not the total count of FX_MODE_ definitions. This is because some effects may have been removed but their IDs are not reused, creating gaps in the numbering sequence. MODE_COUNT is used for array bounds and range checking.
Learnt from: netmindz
PR: wled/WLED#4728
File: wled00/FX.h:378-378
Timestamp: 2025-06-15T09:59:52.720Z
Learning: In WLED's FX.h, MODE_COUNT represents the highest FX_MODE_ ID + 1, not the total count of FX_MODE_ definitions. This is because some effects may have been removed but their IDs are not reused, creating gaps in the numbering sequence. MODE_COUNT is used for array bounds and range checking.
Learnt from: KrX3D
PR: wled/WLED#4237
File: usermods/INA219_v2/INA219_v2.cpp:265-276
Timestamp: 2025-04-18T22:27:58.634Z
Learning: When implementing MQTT message handling in WLED usermods, use `strstr(topic, "/specific/path")` instead of `strcmp_P(topic, PSTR("/specific/path"))` to properly match topics that include the device prefix. The full MQTT topic typically follows the pattern `<mqttDeviceTopic>/specific/path`.
usermods/user_fx/README.md (8)
Learnt from: netmindz
PR: wled/WLED#4728
File: wled00/FX.h:378-378
Timestamp: 2025-06-15T09:59:52.720Z
Learning: In WLED's FX.h, MODE_COUNT represents the highest FX_MODE_ ID + 1, not the total count of FX_MODE_ definitions. This is because some effects may have been removed but their IDs are not reused, creating gaps in the numbering sequence. MODE_COUNT is used for array bounds and range checking.
Learnt from: netmindz
PR: wled/WLED#4728
File: wled00/FX.h:378-378
Timestamp: 2025-06-15T09:59:52.720Z
Learning: In WLED's FX.h, MODE_COUNT represents the highest FX_MODE_ ID + 1, not the total count of FX_MODE_ definitions. This is because some effects may have been removed but their IDs are not reused, creating gaps in the numbering sequence. MODE_COUNT is used for array bounds and range checking.
Learnt from: willmmiles
PR: wled/WLED#4623
File: usermods/word-clock-matrix/word-clock-matrix.cpp:332-332
Timestamp: 2025-03-29T01:22:54.617Z
Learning: In the WLED project, hardcoded usermod IDs (like 500 in the WordClockMatrix's getId() method) are intentionally used as part of a strategy to avoid modifying core code. There are plans to remove numeric usermod IDs entirely in the future.
Learnt from: DedeHai
PR: wled/WLED#4750
File: usermods/audioreactive/audio_reactive.cpp:311-321
Timestamp: 2025-06-27T06:04:44.652Z
Learning: In WLED's AudioReactive usermod, FFT buffer memory (valFFT, windowFFT) is allocated once during initialization and never deallocated, following typical embedded system design where core functionality buffers persist for the application lifetime. Raw buffer pointers for aligned allocations don't need to be tracked in the current implementation since deallocation is never performed.
Learnt from: KrX3D
PR: wled/WLED#4237
File: usermods/INA219_v2/INA219_v2.cpp:265-276
Timestamp: 2025-04-18T22:27:58.634Z
Learning: When implementing MQTT message handling in WLED usermods, use `strstr(topic, "/specific/path")` instead of `strcmp_P(topic, PSTR("/specific/path"))` to properly match topics that include the device prefix. The full MQTT topic typically follows the pattern `<mqttDeviceTopic>/specific/path`.
Learnt from: DedeHai
PR: wled/WLED#4682
File: wled00/FX.cpp:9016-9039
Timestamp: 2025-05-09T18:48:21.296Z
Learning: WLED does not support matrices large enough (≥1024 px) for 32-bit overflow in dx*dx + dy*dy to be a practical concern in particle system effects.
Learnt from: blazoncek
PR: wled/WLED#4667
File: usermods/user_fx/user_fx.cpp:27-30
Timestamp: 2025-04-30T05:41:03.633Z
Learning: In WLED, the Segment::allocateData() method already includes optimization to check if data is allocated and sufficiently sized, handling buffer reuse to reduce memory fragmentation. Adding an external check like `if (SEGENV.data == nullptr && !SEGENV.allocateData(dataSize))` is unnecessary and could be problematic, as it bypasses proper size verification.
Learnt from: willmmiles
PR: wled/WLED#4712
File: wled00/FX_fcn.cpp:992-993
Timestamp: 2025-06-07T15:58:42.579Z
Learning: In WLED segments, the backing pixel buffer is always allocated to the full physical segment size, but effect rendering only uses a subset when mirror or grouping are enabled. For 2D segments, this subset is vWidth() * vHeight(), and for 1D segments it's vLength(). Color processing operations like fade_out should iterate over this rendering subset, not the full allocated buffer.
🪛 LanguageTool
usermods/user_fx/README.md
[style] ~13-~13: Consider removing “of” to be more concise
Context: ...area is where you place the FX code for all of the custom effects you want to use. This m...
(ALL_OF_THE)
[style] ~15-~15: As a shorter alternative for ‘able to’, consider using “can”.
Context: ...mods have to be registered so that they are able to be compiled into your binary. We will ...
(BE_ABLE_TO)
[style] ~15-~15: Avoid the passive voice after ‘to be able to’.
Context: ... be registered so that they are able to be compiled into your binary. We will go into grea...
(ABLE_TO_PASSIVE)
[uncategorized] ~26-~26: You might be missing the article “the” here.
Context: ...elColor()` 4. The function is called at current frame rate. Below are some helpful var...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[uncategorized] ~36-~36: You might be missing the article “a” here.
Context: ...be changed at any time if the user sets new segment size(s). | | SEGCOLOR(x) ...
(AI_EN_LECTOR_MISSING_DETERMINER_A)
[uncategorized] ~37-~37: You might be missing the article “the” here.
Context: ... ??? | Gets user-selected colors from UI, where x is an integer 1, 2, or 3 fr pr...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[uncategorized] ~40-~40: Possible missing comma found.
Context: ... | Easy way to specify a Palette. This function which should be favoured over `ColorFro...
(AI_HYDRA_LEO_MISSING_COMMA)
[uncategorized] ~44-~44: Possible missing comma found.
Context: ...eally true anymore with segment layering but not doing so may still result in glitch...
(AI_HYDRA_LEO_MISSING_COMMA)
[typographical] ~51-~51: It appears that a comma is missing.
Context: ... Understanding 2D WLED Effects In this section we give some advice to those who are ne...
(DURING_THAT_TIME_COMMA)
[uncategorized] ~55-~55: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...le. This file handles all other imports and it has all the global variable declarat...
(COMMA_COMPOUND_SENTENCE)
[uncategorized] ~72-~72: Possible missing comma found.
Context: ...lock contains several constant variable definitions which essentially serve to extract the ...
(AI_HYDRA_LEO_MISSING_COMMA)
[misspelling] ~93-~93: Nonstandard phrase. Did you mean: “from 0 to 255”?
Context: ...MENT.speed (user-controllable parameter from 0–255) to a value between 20 and 80 Hz. * T...
(FROM_X_Y)
[uncategorized] ~95-~95: Possible missing comma found.
Context: ...gher speed = more frames per second). * Next we convert refresh rate from Hz to mill...
(AI_HYDRA_LEO_MISSING_COMMA)
[uncategorized] ~95-~95: You might be missing the article “the” here.
Context: ...e frames per second). * Next we convert refresh rate from Hz to milliseconds. (It’s eas...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[uncategorized] ~99-~99: Possible missing comma found.
Context: ...re diffusion = smoother flame spread. * Next we assign SEGMENT.intensity (user inp...
(AI_HYDRA_LEO_MISSING_COMMA)
[uncategorized] ~121-~121: You might be missing the article “the” here.
Context: ...nd the effect can’t proceed. * It calls previously defined mode_static() fallback effect...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[uncategorized] ~150-~150: The preposition “of” seems more likely in this position.
Context: ...conditional statement in the first line fo code ensures the effect updates on a fi...
(AI_EN_LECTOR_REPLACEMENT_PREPOSITION)
[uncategorized] ~168-~168: Possible missing preposition found.
Context: ...whether we even attempt to spawn sparks this frame. * hw_random8() gives a rando...
(AI_HYDRA_LEO_MISSING_IN)
[uncategorized] ~199-~199: Possible missing article found.
Context: ...Starting with the current heat value of pixel (x, y) assigned v: * if there’s a p...
(AI_HYDRA_LEO_MISSING_A)
[uncategorized] ~224-~224: Possible missing comma found.
Context: ... color-rendering for each pixel row.) * Next we update the main segment data with th...
(AI_HYDRA_LEO_MISSING_COMMA)
[grammar] ~226-~226: Use the plural noun “” with the number ‘255’.
Context: ...olor` from the current palette with 255 brightness, and no wrapping in palette lookup. *...
(IN_CD_PUNCTUATION)
[typographical] ~228-~228: Consider adding a comma after ‘Finally’ for more clarity.
Context: ... flames (e.g., yellow → red → black). * Finally we set the rendered color for the pixel...
(RB_LY_COMMA)
[grammar] ~230-~230: The word “fallback” is a noun. The verb is spelled with a space.
Context: ...h row. * If palette use is disabled, we fallback to fading a base color. * SEGCOLOR(0)...
(NOUN_VERB_CONFUSION)
[grammar] ~251-~251: Did you mean the adverb/preposition “within”?
Context: ...ines how the effect is to be interacted with in the UI: ```cpp static const char data...
(WITH_IN)
[typographical] ~278-~278: The word “otherwise” is an adverb that can’t be used like a conjunction, and therefore needs to be separated from the sentence.
Context: ...s is enabled, the effect uses a palette ColorFromPalette(), otherwise it fades from SEGCOLOR(0). The first...
(THUS_SENTENCE)
[style] ~280-~280: ‘in conjunction with’ might be wordy. Consider a shorter alternative.
Context: ...s to be selected by the user. But used in conjunction with the checkbox argument, palette use can ...
(EN_WORDINESS_PREMIUM_IN_CONJUNCTION_WITH)
[uncategorized] ~296-~296: You might be missing the article “a” here.
Context: ... line of code defines sinelon base as static helper function. This is how all effec...
(AI_EN_LECTOR_MISSING_DETERMINER_A)
[uncategorized] ~328-~328: Loose punctuation mark.
Context: ...2_t color2 = SEGCOLOR(2); ``` * color1: main moving dot color, chosen from pale...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~328-~328: You might be missing the article “a” here.
Context: ...r1`: main moving dot color, chosen from palette using the current position as index. * ...
(AI_EN_LECTOR_MISSING_DETERMINER_A)
[uncategorized] ~329-~329: Loose punctuation mark.
Context: ...he current position as index. * color2: secondary color from user-configured co...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~331-~331: This word is normally spelled with a hyphen.
Context: ... account the optional argument for if a Rainbow colored palette is in use: ```cpp if (rainbow...
(RAINBOW_COLORED)
[style] ~345-~345: ‘takes into account’ might be wordy. Consider a shorter alternative.
Context: ...with the selected color. The next line takes into account another one of the optional arguments f...
(EN_WORDINESS_PREMIUM_TAKES_INTO_ACCOUNT)
[uncategorized] ~345-~345: Possible missing comma found.
Context: ...ect to potentially handle dual mirrored dots which create the animation: ```cpp if...
(AI_HYDRA_LEO_MISSING_COMMA)
[uncategorized] ~355-~355: You might be missing the article “the” here.
Context: ...If color2 is not set (0), fallback to same palette color as color1. * In `rain...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[uncategorized] ~375-~375: You might be missing the article “the” here.
Context: ...pos; } ``` * The first line checks if current position has changed since last frame. ...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[grammar] ~375-~375: The verb form ‘has’ does not seem to match the subject ‘checks’.
Context: ...e first line checks if current position has changed since last frame. (Prevents ho...
(SUBJECT_VERB_AGREEMENT_PLURAL)
[uncategorized] ~375-~375: You might be missing the article “the” here.
Context: ...s if current position has changed since last frame. (Prevents holes if the dot move...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[uncategorized] ~376-~376: You might be missing the article “a” here.
Context: ....aux0) and new position (pos) to ensure smooth continuous trail. * Works in both dir...
(AI_EN_LECTOR_MISSING_DETERMINER_A)
[uncategorized] ~444-~444: Possible missing comma found.
Context: ...important one that registers the custom effect so WLED knows about it. * 255: Tempor...
(AI_HYDRA_LEO_MISSING_COMMA)
[uncategorized] ~447-~447: Loose punctuation mark.
Context: ...ction. * _data_FX_MODE_DIFFUSIONFIRE: Metadata string stored in PROGMEM, desc...
(UNLIKELY_OPENING_PUNCTUATION)
[grammar] ~467-~467: The verb “add” needs to be in the to-infinitive form.
Context: ...this Usermod So now let's say that you wanted add the effects "Diffusion Fire" and "Sine...
(MISSING_TO_BEFORE_A_VERB)
[style] ~469-~469: Did you mean ‘different from’? ‘Different than’ is often considered colloquial style.
Context: ...ell--and to name it something different than what's already inside the core WLED cod...
(DIFFERENT_THAN)
[duplication] ~474-~474: Possible typo: you repeated a word.
Context: ... Usermod class. * Compile the code! ## Compiling Compiling WLED yourself is beyond the scope of th...
(ENGLISH_WORD_REPEAT_RULE)
🪛 markdownlint-cli2 (0.17.2)
usermods/user_fx/README.md
32-32: Table pipe style
Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe
(MD055, table-pipe-style)
259-259: Hard tabs
Column: 12
(MD010, no-hard-tabs)
261-261: Hard tabs
Column: 5
(MD010, no-hard-tabs)
262-262: Hard tabs
Column: 5
(MD010, no-hard-tabs)
263-263: Hard tabs
Column: 5
(MD010, no-hard-tabs)
264-264: Hard tabs
Column: 5
(MD010, no-hard-tabs)
265-265: Hard tabs
Column: 5
(MD010, no-hard-tabs)
266-266: Hard tabs
Column: 12
(MD010, no-hard-tabs)
267-267: Hard tabs
Column: 5
(MD010, no-hard-tabs)
268-268: Hard tabs
Column: 5
(MD010, no-hard-tabs)
|
please update to latest main code to resolve all conflicts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (2)
usermods/user_fx/README.md (2)
50-52: Unresolved placeholder about helper functionsThe sentence starting with “explaining available functions for pixel drawing” is still a TODO. Either list helpers like
move(),blur(),fade_out()etc., or delete the line before publishing.
70-71:TODOleft in “Static Effect Definition” section
TODOis still present; supply a minimal fallback example or remove it to avoid shipping incomplete docs.
🧹 Nitpick comments (3)
usermods/user_fx/README.md (3)
3-4: Fix typos and wording in the introduction
depracated→deprecated, and the sentence reads a bit clumsily.-...to load in depracated WLED effects that you want to bring back--all without having to mess with the core WLED source code. +...to load deprecated WLED effects that you want to bring back — all without touching the core WLED source code.
14-14: Inconsistent heading caseThe anchor text
* [CHange Log]has a stray capital “H”. Consistency matters for anchor links.-* [CHange Log](#change-log) +* [Change Log](#change-log)
484-487: Empty “Change Log” sectionA heading without content looks unfinished. Add at least the initial entry (e.g. “v1.0 – initial release of README”) or drop the section.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
usermods/user_fx/README.md(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: willmmiles
PR: wled/WLED#4623
File: usermods/word-clock-matrix/word-clock-matrix.cpp:332-332
Timestamp: 2025-03-29T01:22:54.617Z
Learning: In the WLED project, hardcoded usermod IDs (like 500 in the WordClockMatrix's getId() method) are intentionally used as part of a strategy to avoid modifying core code. There are plans to remove numeric usermod IDs entirely in the future.
Learnt from: netmindz
PR: wled/WLED#4728
File: wled00/FX.h:378-378
Timestamp: 2025-06-15T09:59:52.720Z
Learning: In WLED's FX.h, MODE_COUNT represents the highest FX_MODE_ ID + 1, not the total count of FX_MODE_ definitions. This is because some effects may have been removed but their IDs are not reused, creating gaps in the numbering sequence. MODE_COUNT is used for array bounds and range checking.
Learnt from: netmindz
PR: wled/WLED#4728
File: wled00/FX.h:378-378
Timestamp: 2025-06-15T09:59:52.720Z
Learning: In WLED's FX.h, MODE_COUNT represents the highest FX_MODE_ ID + 1, not the total count of FX_MODE_ definitions. This is because some effects may have been removed but their IDs are not reused, creating gaps in the numbering sequence. MODE_COUNT is used for array bounds and range checking.
Learnt from: KrX3D
PR: wled/WLED#4237
File: usermods/INA219_v2/INA219_v2.cpp:265-276
Timestamp: 2025-04-18T22:27:58.634Z
Learning: When implementing MQTT message handling in WLED usermods, use `strstr(topic, "/specific/path")` instead of `strcmp_P(topic, PSTR("/specific/path"))` to properly match topics that include the device prefix. The full MQTT topic typically follows the pattern `<mqttDeviceTopic>/specific/path`.
Learnt from: DedeHai
PR: wled/WLED#4750
File: usermods/audioreactive/audio_reactive.cpp:311-321
Timestamp: 2025-06-27T06:04:44.652Z
Learning: In WLED's AudioReactive usermod, FFT buffer memory (valFFT, windowFFT) is allocated once during initialization and never deallocated, following typical embedded system design where core functionality buffers persist for the application lifetime. Raw buffer pointers for aligned allocations don't need to be tracked in the current implementation since deallocation is never performed.
usermods/user_fx/README.md (8)
Learnt from: netmindz
PR: wled/WLED#4728
File: wled00/FX.h:378-378
Timestamp: 2025-06-15T09:59:52.720Z
Learning: In WLED's FX.h, MODE_COUNT represents the highest FX_MODE_ ID + 1, not the total count of FX_MODE_ definitions. This is because some effects may have been removed but their IDs are not reused, creating gaps in the numbering sequence. MODE_COUNT is used for array bounds and range checking.
Learnt from: netmindz
PR: wled/WLED#4728
File: wled00/FX.h:378-378
Timestamp: 2025-06-15T09:59:52.720Z
Learning: In WLED's FX.h, MODE_COUNT represents the highest FX_MODE_ ID + 1, not the total count of FX_MODE_ definitions. This is because some effects may have been removed but their IDs are not reused, creating gaps in the numbering sequence. MODE_COUNT is used for array bounds and range checking.
Learnt from: willmmiles
PR: wled/WLED#4623
File: usermods/word-clock-matrix/word-clock-matrix.cpp:332-332
Timestamp: 2025-03-29T01:22:54.617Z
Learning: In the WLED project, hardcoded usermod IDs (like 500 in the WordClockMatrix's getId() method) are intentionally used as part of a strategy to avoid modifying core code. There are plans to remove numeric usermod IDs entirely in the future.
Learnt from: KrX3D
PR: wled/WLED#4237
File: usermods/INA219_v2/INA219_v2.cpp:265-276
Timestamp: 2025-04-18T22:27:58.634Z
Learning: When implementing MQTT message handling in WLED usermods, use `strstr(topic, "/specific/path")` instead of `strcmp_P(topic, PSTR("/specific/path"))` to properly match topics that include the device prefix. The full MQTT topic typically follows the pattern `<mqttDeviceTopic>/specific/path`.
Learnt from: DedeHai
PR: wled/WLED#4682
File: wled00/FX.cpp:9016-9039
Timestamp: 2025-05-09T18:48:21.296Z
Learning: WLED does not support matrices large enough (≥1024 px) for 32-bit overflow in dx*dx + dy*dy to be a practical concern in particle system effects.
Learnt from: blazoncek
PR: wled/WLED#4667
File: usermods/user_fx/user_fx.cpp:27-30
Timestamp: 2025-04-30T05:41:03.633Z
Learning: In WLED, the Segment::allocateData() method already includes optimization to check if data is allocated and sufficiently sized, handling buffer reuse to reduce memory fragmentation. Adding an external check like `if (SEGENV.data == nullptr && !SEGENV.allocateData(dataSize))` is unnecessary and could be problematic, as it bypasses proper size verification.
Learnt from: willmmiles
PR: wled/WLED#4712
File: wled00/FX_fcn.cpp:992-993
Timestamp: 2025-06-07T15:58:42.579Z
Learning: In WLED segments, the backing pixel buffer is always allocated to the full physical segment size, but effect rendering only uses a subset when mirror or grouping are enabled. For 2D segments, this subset is vWidth() * vHeight(), and for 1D segments it's vLength(). Color processing operations like fade_out should iterate over this rendering subset, not the full allocated buffer.
Learnt from: DedeHai
PR: wled/WLED#4750
File: usermods/audioreactive/audio_reactive.cpp:311-321
Timestamp: 2025-06-27T06:04:44.652Z
Learning: In WLED's AudioReactive usermod, FFT buffer memory (valFFT, windowFFT) is allocated once during initialization and never deallocated, following typical embedded system design where core functionality buffers persist for the application lifetime. Raw buffer pointers for aligned allocations don't need to be tracked in the current implementation since deallocation is never performed.
🪛 LanguageTool
usermods/user_fx/README.md
[style] ~20-~20: Consider removing “of” to be more concise
Context: ...area is where you place the FX code for all of the custom effects you want to use. This m...
(ALL_OF_THE)
[style] ~22-~22: As a shorter alternative for ‘able to’, consider using “can”.
Context: ...mods have to be registered so that they are able to be compiled into your binary. We will ...
(BE_ABLE_TO)
[style] ~22-~22: Avoid the passive voice after ‘to be able to’.
Context: ... be registered so that they are able to be compiled into your binary. We will go into grea...
(ABLE_TO_PASSIVE)
[uncategorized] ~33-~33: You might be missing the article “the” here.
Context: ...elColor()` 4. The function is called at current frame rate. Below are some helpful var...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[uncategorized] ~43-~43: You might be missing the article “a” here.
Context: ...be changed at any time if the user sets new segment size(s). | | SEGCOLOR(x) ...
(AI_EN_LECTOR_MISSING_DETERMINER_A)
[uncategorized] ~44-~44: You might be missing the article “the” here.
Context: ... ??? | Gets user-selected colors from UI, where x is an integer 1, 2, or 3 fr pr...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[uncategorized] ~47-~47: Possible missing comma found.
Context: ... | Easy way to specify a Palette. This function which should be favoured over `ColorFro...
(AI_HYDRA_LEO_MISSING_COMMA)
[uncategorized] ~51-~51: Possible missing comma found.
Context: ...eally true anymore with segment layering but not doing so may still result in glitch...
(AI_HYDRA_LEO_MISSING_COMMA)
[typographical] ~58-~58: It appears that a comma is missing.
Context: ... Understanding 2D WLED Effects In this section we give some advice to those who are ne...
(DURING_THAT_TIME_COMMA)
[uncategorized] ~62-~62: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...le. This file handles all other imports and it has all the global variable declarat...
(COMMA_COMPOUND_SENTENCE)
[uncategorized] ~79-~79: Possible missing comma found.
Context: ...lock contains several constant variable definitions which essentially serve to extract the ...
(AI_HYDRA_LEO_MISSING_COMMA)
[misspelling] ~100-~100: Nonstandard phrase. Did you mean: “from 0 to 255”?
Context: ...MENT.speed (user-controllable parameter from 0–255) to a value between 20 and 80 Hz. * T...
(FROM_X_Y)
[uncategorized] ~102-~102: Possible missing comma found.
Context: ...gher speed = more frames per second). * Next we convert refresh rate from Hz to mill...
(AI_HYDRA_LEO_MISSING_COMMA)
[uncategorized] ~102-~102: You might be missing the article “the” here.
Context: ...e frames per second). * Next we convert refresh rate from Hz to milliseconds. (It’s eas...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[uncategorized] ~106-~106: Possible missing comma found.
Context: ...re diffusion = smoother flame spread. * Next we assign SEGMENT.intensity (user inp...
(AI_HYDRA_LEO_MISSING_COMMA)
[uncategorized] ~128-~128: You might be missing the article “the” here.
Context: ...nd the effect can’t proceed. * It calls previously defined mode_static() fallback effect...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[uncategorized] ~157-~157: The preposition “of” seems more likely in this position.
Context: ...conditional statement in the first line fo code ensures the effect updates on a fi...
(AI_EN_LECTOR_REPLACEMENT_PREPOSITION)
[uncategorized] ~175-~175: Possible missing preposition found.
Context: ...whether we even attempt to spawn sparks this frame. * hw_random8() gives a rando...
(AI_HYDRA_LEO_MISSING_IN)
[uncategorized] ~206-~206: Possible missing article found.
Context: ...Starting with the current heat value of pixel (x, y) assigned v: * if there’s a p...
(AI_HYDRA_LEO_MISSING_A)
[uncategorized] ~231-~231: Possible missing comma found.
Context: ... color-rendering for each pixel row.) * Next we update the main segment data with th...
(AI_HYDRA_LEO_MISSING_COMMA)
[grammar] ~233-~233: Use the plural noun “” with the number ‘255’.
Context: ...olor` from the current palette with 255 brightness, and no wrapping in palette lookup. *...
(IN_CD_PUNCTUATION)
[typographical] ~235-~235: Consider adding a comma after ‘Finally’ for more clarity.
Context: ... flames (e.g., yellow → red → black). * Finally we set the rendered color for the pixel...
(RB_LY_COMMA)
[grammar] ~237-~237: The word “fallback” is a noun. The verb is spelled with a space.
Context: ...h row. * If palette use is disabled, we fallback to fading a base color. * SEGCOLOR(0)...
(NOUN_VERB_CONFUSION)
[grammar] ~258-~258: Did you mean the adverb/preposition “within”?
Context: ...ines how the effect is to be interacted with in the UI: ```cpp static const char data...
(WITH_IN)
[typographical] ~285-~285: The word “otherwise” is an adverb that can’t be used like a conjunction, and therefore needs to be separated from the sentence.
Context: ...s is enabled, the effect uses a palette ColorFromPalette(), otherwise it fades from SEGCOLOR(0). The first...
(THUS_SENTENCE)
[style] ~287-~287: ‘in conjunction with’ might be wordy. Consider a shorter alternative.
Context: ...s to be selected by the user. But used in conjunction with the checkbox argument, palette use can ...
(EN_WORDINESS_PREMIUM_IN_CONJUNCTION_WITH)
[uncategorized] ~303-~303: You might be missing the article “a” here.
Context: ... line of code defines sinelon base as static helper function. This is how all effec...
(AI_EN_LECTOR_MISSING_DETERMINER_A)
[uncategorized] ~335-~335: Loose punctuation mark.
Context: ...2_t color2 = SEGCOLOR(2); ``` * color1: main moving dot color, chosen from pale...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~335-~335: You might be missing the article “a” here.
Context: ...r1`: main moving dot color, chosen from palette using the current position as index. * ...
(AI_EN_LECTOR_MISSING_DETERMINER_A)
[uncategorized] ~336-~336: Loose punctuation mark.
Context: ...he current position as index. * color2: secondary color from user-configured co...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~338-~338: This word is normally spelled with a hyphen.
Context: ... account the optional argument for if a Rainbow colored palette is in use: ```cpp if (rainbow...
(RAINBOW_COLORED)
[style] ~352-~352: ‘takes into account’ might be wordy. Consider a shorter alternative.
Context: ...with the selected color. The next line takes into account another one of the optional arguments f...
(EN_WORDINESS_PREMIUM_TAKES_INTO_ACCOUNT)
[uncategorized] ~352-~352: Possible missing comma found.
Context: ...ect to potentially handle dual mirrored dots which create the animation: ```cpp if...
(AI_HYDRA_LEO_MISSING_COMMA)
[uncategorized] ~362-~362: You might be missing the article “the” here.
Context: ...If color2 is not set (0), fallback to same palette color as color1. * In `rain...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[uncategorized] ~382-~382: You might be missing the article “the” here.
Context: ...pos; } ``` * The first line checks if current position has changed since last frame. ...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[grammar] ~382-~382: The verb form ‘has’ does not seem to match the subject ‘checks’.
Context: ...e first line checks if current position has changed since last frame. (Prevents ho...
(SUBJECT_VERB_AGREEMENT_PLURAL)
[uncategorized] ~382-~382: You might be missing the article “the” here.
Context: ...s if current position has changed since last frame. (Prevents holes if the dot move...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[uncategorized] ~383-~383: You might be missing the article “a” here.
Context: ....aux0) and new position (pos) to ensure smooth continuous trail. * Works in both dir...
(AI_EN_LECTOR_MISSING_DETERMINER_A)
[uncategorized] ~451-~451: Possible missing comma found.
Context: ...important one that registers the custom effect so WLED knows about it. * 255: Tempor...
(AI_HYDRA_LEO_MISSING_COMMA)
[uncategorized] ~454-~454: Loose punctuation mark.
Context: ...ction. * _data_FX_MODE_DIFFUSIONFIRE: Metadata string stored in PROGMEM, desc...
(UNLIKELY_OPENING_PUNCTUATION)
[grammar] ~474-~474: The verb “add” needs to be in the to-infinitive form.
Context: ...this Usermod So now let's say that you wanted add the effects "Diffusion Fire" and "Sine...
(MISSING_TO_BEFORE_A_VERB)
[style] ~476-~476: Did you mean ‘different from’? ‘Different than’ is often considered colloquial style.
Context: ...ell--and to name it something different than what's already inside the core WLED cod...
(DIFFERENT_THAN)
[duplication] ~480-~480: Possible typo: you repeated a word.
Context: ... Usermod class. * Compile the code! ## Compiling Compiling WLED yourself is beyond the scope of th...
(ENGLISH_WORD_REPEAT_RULE)
🪛 markdownlint-cli2 (0.17.2)
usermods/user_fx/README.md
39-39: Table pipe style
Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe
(MD055, table-pipe-style)
266-266: Hard tabs
Column: 12
(MD010, no-hard-tabs)
268-268: Hard tabs
Column: 5
(MD010, no-hard-tabs)
269-269: Hard tabs
Column: 5
(MD010, no-hard-tabs)
270-270: Hard tabs
Column: 5
(MD010, no-hard-tabs)
271-271: Hard tabs
Column: 5
(MD010, no-hard-tabs)
272-272: Hard tabs
Column: 5
(MD010, no-hard-tabs)
273-273: Hard tabs
Column: 12
(MD010, no-hard-tabs)
274-274: Hard tabs
Column: 5
(MD010, no-hard-tabs)
275-275: Hard tabs
Column: 5
(MD010, no-hard-tabs)
usermods/user_fx/README.md
Outdated
| | Syntax Element | Size | Description | | ||
| | :---------------------------------------------- | :----- | :---------- | | ||
| | `SEGMENT.intensity / speed / custom1 etc.` | 8-bit | This syntax helps you utilize the UI sliders that can make certain elements of your running code editable by the user. (These can be controlled by the API as well.) | ||
| | `SEGENV.aux0` | ???? | A temporary state variable to keep track of last position. (how does this relate to aux1?) | | ||
| | `SEGENV.call` | | A counter for how many times this effect function has been invoked since it started. | | ||
| | `strip.now` | | Current timestamp in milliseconds. | | ||
| | `SEGLEN / SEG_W / SEG_H` | ??? | These variables are macros that help define the length and width of your LED strip/matrix segment. They can be changed at any time if the user sets new segment size(s). | | ||
| | `SEGCOLOR(x)` | ??? | Gets user-selected colors from UI, where x is an integer 1, 2, or 3 fr primary, secondary, and tertiary colors, respectively. (and how it relates to meta string??) | | ||
| | `SEGMENT.setPixelColor` | | | | ||
| | `SEGPALETTE` | | | | ||
| | `SEGMENT.color_from_palette()` | ??? | Easy way to specify a Palette. This function which should be favoured over `ColorFromPalette()`. | | ||
| | `hw_random8()` | 8-bit | Generates a random integer. | | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Broken Markdown table & missing information
The table violates MD055 (no trailing pipes) and still contains ???/???? placeholders. Replace them with real sizes/descriptions and close each row with |.
-| `SEGMENT.intensity / speed / custom1 etc.` | 8-bit | This syntax helps you utilize the UI sliders that can make certain elements of your running code editable by the user. (These can be controlled by the API as well.)
-| `SEGENV.aux0` | ???? | A temporary state variable to keep track of last position. (how does this relate to aux1?) |
-| `SEGENV.call` | | A counter for how many times this effect function has been invoked since it started. |
-| `strip.now` | | Current timestamp in milliseconds. |
-| `SEGLEN / SEG_W / SEG_H` | ??? | These variables are macros that help define the length and width of your LED strip/matrix segment. They can be changed at any time if the user sets new segment size(s). |
-| `SEGCOLOR(x)` | ??? | Gets user-selected colors from UI, where x is an integer 1, 2, or 3 fr primary, secondary, and tertiary colors, respectively. (and how it relates to meta string??) |
-| `SEGMENT.setPixelColor` | | |
-| `SEGPALETTE` | | |
-| `SEGMENT.color_from_palette()` | ??? | Easy way to specify a Palette. This function which should be favoured over `ColorFromPalette()`. |
-| `hw_random8()` | 8-bit | Generates a random integer. |
+| `SEGMENT.intensity / speed / custom1 …` | 8-bit | UI-exposed sliders / knobs (also controllable via JSON API) |
+| `SEGENV.aux0 / aux1` | 32-bit | Scratch registers for effect state (e.g. previous position) |
+| `SEGENV.call` | 32-bit | Invocation counter since effect start |
+| `strip.now` | 32-bit | Current time in ms (millis()) |
+| `SEGLEN / SEG_W / SEG_H` | 16-bit | Current segment length / width / height |
+| `SEGCOLOR(n)` | 24-bit | User-selected base colors (`n` = 0,1,2) |
+| `SEGMENT.setPixelColor()` | — | Sets one LED by 1-D index |
+| `SEGPALETTE` | 8-bit | Current palette index |
+| `SEGMENT.color_from_palette()` | — | Palette-aware helper (prefer over `ColorFromPalette`) |
+| `hw_random8()` | 8-bit | Hardware RNG 0-255 |📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| | Syntax Element | Size | Description | | |
| | :---------------------------------------------- | :----- | :---------- | | |
| | `SEGMENT.intensity / speed / custom1 etc.` | 8-bit | This syntax helps you utilize the UI sliders that can make certain elements of your running code editable by the user. (These can be controlled by the API as well.) | |
| | `SEGENV.aux0` | ???? | A temporary state variable to keep track of last position. (how does this relate to aux1?) | | |
| | `SEGENV.call` | | A counter for how many times this effect function has been invoked since it started. | | |
| | `strip.now` | | Current timestamp in milliseconds. | | |
| | `SEGLEN / SEG_W / SEG_H` | ??? | These variables are macros that help define the length and width of your LED strip/matrix segment. They can be changed at any time if the user sets new segment size(s). | | |
| | `SEGCOLOR(x)` | ??? | Gets user-selected colors from UI, where x is an integer 1, 2, or 3 fr primary, secondary, and tertiary colors, respectively. (and how it relates to meta string??) | | |
| | `SEGMENT.setPixelColor` | | | | |
| | `SEGPALETTE` | | | | |
| | `SEGMENT.color_from_palette()` | ??? | Easy way to specify a Palette. This function which should be favoured over `ColorFromPalette()`. | | |
| | `hw_random8()` | 8-bit | Generates a random integer. | | |
| | Syntax Element | Size | Description | | |
| | :---------------------------------------------- | :----- | :---------- | | |
| | `SEGMENT.intensity / speed / custom1 …` | 8-bit | UI-exposed sliders / knobs (also controllable via JSON API) | | |
| | `SEGENV.aux0 / aux1` | 32-bit | Scratch registers for effect state (e.g. previous position) | | |
| | `SEGENV.call` | 32-bit | Invocation counter since effect start | | |
| | `strip.now` | 32-bit | Current time in ms (millis()) | | |
| | `SEGLEN / SEG_W / SEG_H` | 16-bit | Current segment length / width / height | | |
| | `SEGCOLOR(n)` | 24-bit | User-selected base colors (`n` = 0,1,2) | | |
| | `SEGMENT.setPixelColor()` | — | Sets one LED by 1-D index | | |
| | `SEGPALETTE` | 8-bit | Current palette index | | |
| | `SEGMENT.color_from_palette()` | — | Palette-aware helper (prefer over `ColorFromPalette`) | | |
| | `hw_random8()` | 8-bit | Hardware RNG 0–255 | |
🧰 Tools
🪛 LanguageTool
[uncategorized] ~43-~43: You might be missing the article “a” here.
Context: ...be changed at any time if the user sets new segment size(s). | | SEGCOLOR(x) ...
(AI_EN_LECTOR_MISSING_DETERMINER_A)
[uncategorized] ~44-~44: You might be missing the article “the” here.
Context: ... ??? | Gets user-selected colors from UI, where x is an integer 1, 2, or 3 fr pr...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[uncategorized] ~47-~47: Possible missing comma found.
Context: ... | Easy way to specify a Palette. This function which should be favoured over `ColorFro...
(AI_HYDRA_LEO_MISSING_COMMA)
🪛 markdownlint-cli2 (0.17.2)
39-39: Table pipe style
Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe
(MD055, table-pipe-style)
🤖 Prompt for AI Agents
In usermods/user_fx/README.md between lines 37 and 49, the markdown table has
missing size and description information marked as ???/???? and violates MD055
by missing trailing pipes. Update the table by filling in accurate sizes and
descriptions for SEGENV.aux0, SEGLEN / SEG_W / SEG_H, SEGCOLOR(x), and
SEGMENT.color_from_palette(), and ensure every row ends with a trailing pipe to
fix the markdown formatting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (3)
usermods/user_fx/README.md (3)
37-48: Broken table layout & placeholder markers – please finalise and re-formatThe “Basic Syntax” table still
• violates MD055 (no trailing pipes)
• contains many???placeholders that were flagged in the last reviewMarkdown linters keep failing and readers have no idea what size each field is.
Consider something like:-| `SEGENV.aux0` | ??? | A temporary state variable … +| `SEGENV.aux0 / aux1` | 32-bit | Scratch registers – often used to store previous positions |and add a trailing
|to every row.Once the cells are populated, linter noise disappears and the doc becomes authoritative.
49-53: Unresolved placeholders for helper APIsRows for
FX_2Dfcn,FX_fcn,move(),blurare still blank (???).
Either supply a one-line description/size or drop them; empty rows look unfinished and mislead new contributors.
69-70: TODO still present – section incompleteThe “Static Effect Definition” paragraph still contains a raw
TODO.
Please add a minimal example or explanation so the README can be published without open tasks.
🧹 Nitpick comments (1)
usermods/user_fx/README.md (1)
280-289: Metadata-breakdown table mis-formattedRow delimiters are missing (
|), quotes are unbalanced, and several descriptions wrap awkwardly.
Readers can’t copy-scan the breakdown.Refactor the block to a standard two-column table; example:
-| "Diffusion Fire@! +| `"Diffusion Fire@!` | Effect name (everything before `@`) |…and so on until
pal=35.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
usermods/user_fx/README.md(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: willmmiles
PR: wled/WLED#4623
File: usermods/word-clock-matrix/word-clock-matrix.cpp:332-332
Timestamp: 2025-03-29T01:22:54.617Z
Learning: In the WLED project, hardcoded usermod IDs (like 500 in the WordClockMatrix's getId() method) are intentionally used as part of a strategy to avoid modifying core code. There are plans to remove numeric usermod IDs entirely in the future.
Learnt from: netmindz
PR: wled/WLED#4728
File: wled00/FX.h:378-378
Timestamp: 2025-06-15T09:59:52.720Z
Learning: In WLED's FX.h, MODE_COUNT represents the highest FX_MODE_ ID + 1, not the total count of FX_MODE_ definitions. This is because some effects may have been removed but their IDs are not reused, creating gaps in the numbering sequence. MODE_COUNT is used for array bounds and range checking.
Learnt from: netmindz
PR: wled/WLED#4728
File: wled00/FX.h:378-378
Timestamp: 2025-06-15T09:59:52.720Z
Learning: In WLED's FX.h, MODE_COUNT represents the highest FX_MODE_ ID + 1, not the total count of FX_MODE_ definitions. This is because some effects may have been removed but their IDs are not reused, creating gaps in the numbering sequence. MODE_COUNT is used for array bounds and range checking.
Learnt from: KrX3D
PR: wled/WLED#4237
File: usermods/INA219_v2/INA219_v2.cpp:265-276
Timestamp: 2025-04-18T22:27:58.634Z
Learning: When implementing MQTT message handling in WLED usermods, use `strstr(topic, "/specific/path")` instead of `strcmp_P(topic, PSTR("/specific/path"))` to properly match topics that include the device prefix. The full MQTT topic typically follows the pattern `<mqttDeviceTopic>/specific/path`.
usermods/user_fx/README.md (9)
Learnt from: netmindz
PR: wled/WLED#4728
File: wled00/FX.h:378-378
Timestamp: 2025-06-15T09:59:52.720Z
Learning: In WLED's FX.h, MODE_COUNT represents the highest FX_MODE_ ID + 1, not the total count of FX_MODE_ definitions. This is because some effects may have been removed but their IDs are not reused, creating gaps in the numbering sequence. MODE_COUNT is used for array bounds and range checking.
Learnt from: netmindz
PR: wled/WLED#4728
File: wled00/FX.h:378-378
Timestamp: 2025-06-15T09:59:52.720Z
Learning: In WLED's FX.h, MODE_COUNT represents the highest FX_MODE_ ID + 1, not the total count of FX_MODE_ definitions. This is because some effects may have been removed but their IDs are not reused, creating gaps in the numbering sequence. MODE_COUNT is used for array bounds and range checking.
Learnt from: willmmiles
PR: wled/WLED#4623
File: usermods/word-clock-matrix/word-clock-matrix.cpp:332-332
Timestamp: 2025-03-29T01:22:54.617Z
Learning: In the WLED project, hardcoded usermod IDs (like 500 in the WordClockMatrix's getId() method) are intentionally used as part of a strategy to avoid modifying core code. There are plans to remove numeric usermod IDs entirely in the future.
Learnt from: KrX3D
PR: wled/WLED#4237
File: usermods/INA219_v2/INA219_v2.cpp:265-276
Timestamp: 2025-04-18T22:27:58.634Z
Learning: When implementing MQTT message handling in WLED usermods, use `strstr(topic, "/specific/path")` instead of `strcmp_P(topic, PSTR("/specific/path"))` to properly match topics that include the device prefix. The full MQTT topic typically follows the pattern `<mqttDeviceTopic>/specific/path`.
Learnt from: DedeHai
PR: wled/WLED#4682
File: wled00/FX.cpp:9016-9039
Timestamp: 2025-05-09T18:48:21.296Z
Learning: WLED does not support matrices large enough (≥1024 px) for 32-bit overflow in dx*dx + dy*dy to be a practical concern in particle system effects.
Learnt from: blazoncek
PR: wled/WLED#4667
File: usermods/user_fx/user_fx.cpp:27-30
Timestamp: 2025-04-30T05:41:03.633Z
Learning: In WLED, the Segment::allocateData() method already includes optimization to check if data is allocated and sufficiently sized, handling buffer reuse to reduce memory fragmentation. Adding an external check like `if (SEGENV.data == nullptr && !SEGENV.allocateData(dataSize))` is unnecessary and could be problematic, as it bypasses proper size verification.
Learnt from: willmmiles
PR: wled/WLED#4712
File: wled00/FX_fcn.cpp:992-993
Timestamp: 2025-06-07T15:58:42.579Z
Learning: In WLED segments, the backing pixel buffer is always allocated to the full physical segment size, but effect rendering only uses a subset when mirror or grouping are enabled. For 2D segments, this subset is vWidth() * vHeight(), and for 1D segments it's vLength(). Color processing operations like fade_out should iterate over this rendering subset, not the full allocated buffer.
Learnt from: KrX3D
PR: wled/WLED#4585
File: usermods/seven_segment_display_reloaded_v2/seven_segment_display_reloaded_v2.h:121-136
Timestamp: 2025-04-27T09:37:28.415Z
Learning: Using PROGMEM for the seven-segment font array (umSSDRNumbers) in the WLED SSDR usermod causes compilation problems, so it should be left as a regular array.
Learnt from: KrX3D
PR: wled/WLED#4585
File: usermods/seven_segment_display_reloaded_v2/seven_segment_display_reloaded_v2.h:121-137
Timestamp: 2025-04-27T10:06:22.545Z
Learning: In the Seven Segment Display Reloaded usermod, the dimension mismatch between the default array (umSSDRNumbers[11][7]) and the override (umSSDRNumbers[11][10] = umSSDR_NUMBERS) is intentional by design, allowing for different use cases with varying numbers of segments per digit.
🪛 LanguageTool
usermods/user_fx/README.md
[style] ~20-~20: Consider removing “of” to be more concise
Context: ...area is where you place the FX code for all of the custom effects you want to use. This m...
(ALL_OF_THE)
[style] ~22-~22: As a shorter alternative for ‘able to’, consider using “can”.
Context: ...mods have to be registered so that they are able to be compiled into your binary. We will ...
(BE_ABLE_TO)
[style] ~22-~22: Avoid the passive voice after ‘to be able to’.
Context: ... be registered so that they are able to be compiled into your binary. We will go into grea...
(ABLE_TO_PASSIVE)
[uncategorized] ~33-~33: You might be missing the article “the” here.
Context: ...elColor()` 4. The function is called at current frame rate. Below are some helpful var...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[uncategorized] ~43-~43: You might be missing the article “a” here.
Context: ...be changed at any time if the user sets new segment size(s). | | SEGCOLOR(x) ...
(AI_EN_LECTOR_MISSING_DETERMINER_A)
[uncategorized] ~44-~44: You might be missing the article “the” here.
Context: ...??? | Gets user-selected colors from UI, where x is an integer 1, 2, or 3 fr pr...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[uncategorized] ~47-~47: Possible missing comma found.
Context: ... | Easy way to specify a Palette. This function which should be favoured over `ColorFro...
(AI_HYDRA_LEO_MISSING_COMMA)
[typographical] ~57-~57: It appears that a comma is missing.
Context: ... Understanding 2D WLED Effects In this section we give some advice to those who are ne...
(DURING_THAT_TIME_COMMA)
[uncategorized] ~61-~61: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...le. This file handles all other imports and it has all the global variable declarat...
(COMMA_COMPOUND_SENTENCE)
[uncategorized] ~78-~78: Possible missing comma found.
Context: ...lock contains several constant variable definitions which essentially serve to extract the ...
(AI_HYDRA_LEO_MISSING_COMMA)
[misspelling] ~99-~99: Nonstandard phrase. Did you mean: “from 0 to 255”?
Context: ...MENT.speed (user-controllable parameter from 0–255) to a value between 20 and 80 Hz. * T...
(FROM_X_Y)
[uncategorized] ~101-~101: Possible missing comma found.
Context: ...gher speed = more frames per second). * Next we convert refresh rate from Hz to mill...
(AI_HYDRA_LEO_MISSING_COMMA)
[uncategorized] ~101-~101: You might be missing the article “the” here.
Context: ...e frames per second). * Next we convert refresh rate from Hz to milliseconds. (It’s eas...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[uncategorized] ~105-~105: Possible missing comma found.
Context: ...re diffusion = smoother flame spread. * Next we assign SEGMENT.intensity (user inp...
(AI_HYDRA_LEO_MISSING_COMMA)
[uncategorized] ~127-~127: You might be missing the article “the” here.
Context: ...nd the effect can’t proceed. * It calls previously defined mode_static() fallback effect...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[uncategorized] ~156-~156: The preposition “of” seems more likely in this position.
Context: ...conditional statement in the first line fo code ensures the effect updates on a fi...
(AI_EN_LECTOR_REPLACEMENT_PREPOSITION)
[uncategorized] ~174-~174: Possible missing preposition found.
Context: ...whether we even attempt to spawn sparks this frame. * hw_random8() gives a rando...
(AI_HYDRA_LEO_MISSING_IN)
[uncategorized] ~205-~205: Possible missing article found.
Context: ...Starting with the current heat value of pixel (x, y) assigned v: * if there’s a p...
(AI_HYDRA_LEO_MISSING_A)
[uncategorized] ~230-~230: Possible missing comma found.
Context: ... color-rendering for each pixel row.) * Next we update the main segment data with th...
(AI_HYDRA_LEO_MISSING_COMMA)
[grammar] ~232-~232: Use the plural noun “” with the number ‘255’.
Context: ...olor` from the current palette with 255 brightness, and no wrapping in palette lookup. *...
(IN_CD_PUNCTUATION)
[typographical] ~234-~234: Consider adding a comma after ‘Finally’ for more clarity.
Context: ... flames (e.g., yellow → red → black). * Finally we set the rendered color for the pixel...
(RB_LY_COMMA)
[grammar] ~236-~236: The word “fallback” is a noun. The verb is spelled with a space.
Context: ...h row. * If palette use is disabled, we fallback to fading a base color. * SEGCOLOR(0)...
(NOUN_VERB_CONFUSION)
[grammar] ~257-~257: Did you mean the adverb/preposition “within”?
Context: ...ines how the effect is to be interacted with in the UI: ```cpp static const char data...
(WITH_IN)
[typographical] ~284-~284: The word “otherwise” is an adverb that can’t be used like a conjunction, and therefore needs to be separated from the sentence.
Context: ...s is enabled, the effect uses a palette ColorFromPalette(), otherwise it fades from SEGCOLOR(0). The first...
(THUS_SENTENCE)
[style] ~286-~286: ‘in conjunction with’ might be wordy. Consider a shorter alternative.
Context: ...s to be selected by the user. But used in conjunction with the checkbox argument, palette use can ...
(EN_WORDINESS_PREMIUM_IN_CONJUNCTION_WITH)
[uncategorized] ~302-~302: You might be missing the article “a” here.
Context: ... line of code defines sinelon base as static helper function. This is how all effec...
(AI_EN_LECTOR_MISSING_DETERMINER_A)
[uncategorized] ~334-~334: Loose punctuation mark.
Context: ...2_t color2 = SEGCOLOR(2); ``` * color1: main moving dot color, chosen from pale...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~334-~334: You might be missing the article “a” here.
Context: ...r1`: main moving dot color, chosen from palette using the current position as index. * ...
(AI_EN_LECTOR_MISSING_DETERMINER_A)
[uncategorized] ~335-~335: Loose punctuation mark.
Context: ...he current position as index. * color2: secondary color from user-configured co...
(UNLIKELY_OPENING_PUNCTUATION)
[uncategorized] ~337-~337: This word is normally spelled with a hyphen.
Context: ... account the optional argument for if a Rainbow colored palette is in use: ```cpp if (rainbow...
(RAINBOW_COLORED)
[style] ~351-~351: ‘takes into account’ might be wordy. Consider a shorter alternative.
Context: ...with the selected color. The next line takes into account another one of the optional arguments f...
(EN_WORDINESS_PREMIUM_TAKES_INTO_ACCOUNT)
[uncategorized] ~351-~351: Possible missing comma found.
Context: ...ect to potentially handle dual mirrored dots which create the animation: ```cpp if...
(AI_HYDRA_LEO_MISSING_COMMA)
[uncategorized] ~361-~361: You might be missing the article “the” here.
Context: ...If color2 is not set (0), fallback to same palette color as color1. * In `rain...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[uncategorized] ~381-~381: You might be missing the article “the” here.
Context: ...pos; } ``` * The first line checks if current position has changed since last frame. ...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[grammar] ~381-~381: The verb form ‘has’ does not seem to match the subject ‘checks’.
Context: ...e first line checks if current position has changed since last frame. (Prevents ho...
(SUBJECT_VERB_AGREEMENT_PLURAL)
[uncategorized] ~381-~381: You might be missing the article “the” here.
Context: ...s if current position has changed since last frame. (Prevents holes if the dot move...
(AI_EN_LECTOR_MISSING_DETERMINER_THE)
[uncategorized] ~382-~382: You might be missing the article “a” here.
Context: ....aux0) and new position (pos) to ensure smooth continuous trail. * Works in both dir...
(AI_EN_LECTOR_MISSING_DETERMINER_A)
[uncategorized] ~450-~450: Possible missing comma found.
Context: ...important one that registers the custom effect so WLED knows about it. * 255: Tempor...
(AI_HYDRA_LEO_MISSING_COMMA)
[uncategorized] ~453-~453: Loose punctuation mark.
Context: ...ction. * _data_FX_MODE_DIFFUSIONFIRE: Metadata string stored in PROGMEM, desc...
(UNLIKELY_OPENING_PUNCTUATION)
[grammar] ~473-~473: The verb “add” needs to be in the to-infinitive form.
Context: ...this Usermod So now let's say that you wanted add the effects "Diffusion Fire" and "Sine...
(MISSING_TO_BEFORE_A_VERB)
[style] ~475-~475: Did you mean ‘different from’? ‘Different than’ is often considered colloquial style.
Context: ...ell--and to name it something different than what's already inside the core WLED cod...
(DIFFERENT_THAN)
[duplication] ~479-~479: Possible typo: you repeated a word.
Context: ... Usermod class. * Compile the code! ## Compiling Compiling WLED yourself is beyond the scope of th...
(ENGLISH_WORD_REPEAT_RULE)
🪛 markdownlint-cli2 (0.17.2)
usermods/user_fx/README.md
39-39: Table pipe style
Expected: leading_and_trailing; Actual: leading_only; Missing trailing pipe
(MD055, table-pipe-style)
265-265: Hard tabs
Column: 12
(MD010, no-hard-tabs)
267-267: Hard tabs
Column: 5
(MD010, no-hard-tabs)
268-268: Hard tabs
Column: 5
(MD010, no-hard-tabs)
269-269: Hard tabs
Column: 5
(MD010, no-hard-tabs)
270-270: Hard tabs
Column: 5
(MD010, no-hard-tabs)
271-271: Hard tabs
Column: 5
(MD010, no-hard-tabs)
272-272: Hard tabs
Column: 12
(MD010, no-hard-tabs)
273-273: Hard tabs
Column: 5
(MD010, no-hard-tabs)
274-274: Hard tabs
Column: 5
(MD010, no-hard-tabs)
usermods/user_fx/README.md
Outdated
| | Parameter | Default tooltip label | | ||
| | :-------- | :-------------------- | | ||
| | sx | Effect speed | | ||
| | ix | Effect intensity | | ||
| | c1 | Custom 1 | | ||
| | c2 | Custom 2 | | ||
| | c3 | Custom 3 | | ||
| | o1 | Option 1 | | ||
| | o2 | Option 2 | | ||
| | o3 | Option 3 | | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Hard tabs & missing pipes inside parameter-tooltip table
The parameter table mixes hard TAB characters (MD010) and lacks trailing pipes, breaking alignment in many Markdown renderers.
-| sx | Effect speed
-| ix | Effect intensity
+| sx | Effect speed |
+| ix | Effect intensity |Convert tabs to spaces and close every row with a |.
This small cleanup fixes both rendering and linter errors.
Committable suggestion skipped: line range outside the PR's diff.
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
265-265: Hard tabs
Column: 12
(MD010, no-hard-tabs)
267-267: Hard tabs
Column: 5
(MD010, no-hard-tabs)
268-268: Hard tabs
Column: 5
(MD010, no-hard-tabs)
269-269: Hard tabs
Column: 5
(MD010, no-hard-tabs)
270-270: Hard tabs
Column: 5
(MD010, no-hard-tabs)
271-271: Hard tabs
Column: 5
(MD010, no-hard-tabs)
272-272: Hard tabs
Column: 12
(MD010, no-hard-tabs)
273-273: Hard tabs
Column: 5
(MD010, no-hard-tabs)
274-274: Hard tabs
Column: 5
(MD010, no-hard-tabs)
🤖 Prompt for AI Agents
In usermods/user_fx/README.md lines 265 to 275, the parameter-tooltip table uses
hard tab characters and is missing trailing pipe characters at the end of each
row, causing alignment and rendering issues. Replace all hard tabs with spaces
and add a trailing pipe `|` at the end of every row to properly close the table
cells and fix the Markdown formatting and linter errors.
Updating README for upcoming user_fx usermod.
Currently has sections regarding the following topics:
The following areas are currently incomplete, in my opinion:
Summary by CodeRabbit
New Features
Documentation
Chores