Skip to content

Commit b8995d2

Browse files
authored
Update README.md
1 parent 28e8ae5 commit b8995d2

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

usermods/user_fx/README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,16 @@ Below are some helpful variables and functions to know as you start your journey
2929

3030
| Syntax Element | Size | Description |
3131
| :---------------------------------------------- | :----- | :---------- |
32-
| `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.)
33-
| `SEGENV.call / step / aux0 / aux1` | ???? | These are useful counters for you to use in your code. |
32+
| `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.)
33+
| `SEGENV.aux0` | ???? | A temporary state variable to keep track of last position. (how does this relate to aux1?) |
34+
| `SEGENV.call` | | A counter for how many times this effect function has been invoked since it started. |
35+
| `strip.now` | | Current timestamp in milliseconds. |
3436
| `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). |
35-
| `SEGCOLOR(x) / SEGPALETTE` | ??? | For user colors from UI (and how it relates to meta string) |
36-
| `SEGMENT.color_from_palette()` | ??? | function which should be favoured over ColorFromPalette() |
37+
| `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??) |
38+
| `SEGMENT.setPixelColor` | | |
39+
| `SEGPALETTE` | | |
40+
| `SEGMENT.color_from_palette()` | ??? | Easy way to specify a Palette. This function which should be favoured over `ColorFromPalette()`. |
41+
| `hw_random8()` | 8-bit | Generates a random integer. |
3742

3843
explaining available functions for pixel drawing (the ones defined in FX_2Dfcn and FX_fcn, like move(), blur() etc.)
3944
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)
@@ -161,7 +166,7 @@ if (hw_random8() > turbulence) {
161166
}
162167
```
163168
* The first line randomizes whether we even attempt to spawn sparks this frame.
164-
* `hw_random8()` gives another random number between 0–255 using a fast hardware RNG.
169+
* `hw_random8()` gives a random number between 0–255 using a fast hardware RNG.
165170
* `turbulence` is a user-controlled parameter (SEGMENT.custom2, set earlier).
166171
* Higher turbulence means this block is less likely to run (because `hw_random8()` is less likely to exceed a high threshold).
167172
* This adds randomness to when sparks appear — simulating natural flicker and chaotic fire.

0 commit comments

Comments
 (0)