Skip to content

Commit 420dfb5

Browse files
authored
Update README.md
1 parent 5201b9a commit 420dfb5

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

usermods/user_fx/README.md

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Multiple Effects can be specified inside this single usermod, as we will illustr
1111
* [Understanding 1D WLED Effects](https://github.com/danewhero/WLED/blob/user_fx/usermods/user_fx/README.md#understanding-1d-wled-effects)
1212
* [Combining Multiple Effects in this Usermod](https://github.com/danewhero/WLED/blob/user_fx/usermods/user_fx/README.md#combining-multiple-effects-in-this-usermod)
1313
* [Compiling](https://github.com/danewhero/WLED/blob/user_fx/usermods/user_fx/README.md#compiling)
14-
* [CHange Log](https://github.com/danewhero/WLED/blob/user_fx/usermods/user_fx/README.md#change-log)
14+
* [Change Log](https://github.com/danewhero/WLED/blob/user_fx/usermods/user_fx/README.md#change-log)
1515

1616
## How The Usermod Works
1717

@@ -37,20 +37,19 @@ Below are some helpful variables and functions to know as you start your journey
3737
| Syntax Element | Size | Description |
3838
| :---------------------------------------------- | :----- | :---------- |
3939
| `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.)
40-
| `SEGENV.aux0` | ???? | A temporary state variable to keep track of last position. (how does this relate to aux1?) |
41-
| `SEGENV.call` | | A counter for how many times this effect function has been invoked since it started. |
42-
| `strip.now` | | Current timestamp in milliseconds. |
43-
| `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). |
44-
| `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??) |
45-
| `SEGMENT.setPixelColor` | | |
46-
| `SEGPALETTE` | | |
47-
| `SEGMENT.color_from_palette()` | ??? | Easy way to specify a Palette. This function which should be favoured over `ColorFromPalette()`. |
40+
| `SEGENV.aux0` | ??? | A temporary state variable to keep track of last position. (how does this relate to aux1?) |
41+
| `SEGENV.call` | ??? | A counter for how many times this effect function has been invoked since it started. |
42+
| `strip.now` | ??? | Current timestamp in milliseconds. |
43+
| `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). |
44+
| `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??) |
45+
| `SEGMENT.setPixelColor` | ??? | |
46+
| `SEGPALETTE` | ??? | |
47+
| `SEGMENT.color_from_palette()` | ??? | Easy way to specify a Palette. This function which should be favoured over `ColorFromPalette()`. |
4848
| `hw_random8()` | 8-bit | Generates a random integer. |
49-
50-
explaining available functions for pixel drawing (the ones defined in FX_2Dfcn and FX_fcn, like move(), blur() etc.)
51-
and MUST render the pixels each frame even if the frame did not change (this is acutally not really true anymore with segment layering but not doing so may still result in glitches)
52-
53-
49+
| `FX_2Dfcn` | ??? | |
50+
| `FX_fcn` | ??? | |
51+
| `move()` | ??? | |
52+
| `blur` | ??? | |
5453

5554

5655
## Understanding 2D WLED Effects
@@ -249,7 +248,7 @@ return FRAMETIME;
249248
* returning the frame time tells WLED how soon this effect wants to be called again.
250249
* `FRAMETIME` is a predefined macro in WLED, typically set to ~16ms, corresponding to ~60 FPS (frames per second).
251250
* Even though the effect logic itself controls when to update based on refresh_ms, WLED will still call this function at roughly FRAMETIME intervals to check whether an update is needed.
252-
* ⚠️ Important: Because the actual frame logic is gated by strip.now - SEGENV.step, returning FRAMETIME here doesn’t cause excessive updates — it just keeps the engine responsive. Also note that an Effect should ALWAYS return FRAMETIME, and choosing a higher number can have negative side effects.
251+
* ⚠️ Important: Because the actual frame logic is gated by strip.now - SEGENV.step, returning FRAMETIME here doesn’t cause excessive updates — it just keeps the engine responsive. **Also note that an Effect should ALWAYS return FRAMETIME. Not doing so can cause glitches.**
253252
* The final bracket closes the `mode_diffusionfire()` function itself.
254253

255254

0 commit comments

Comments
 (0)