From ff351a13dcbfbefce11d212b570797df6d816e6b Mon Sep 17 00:00:00 2001 From: gustebeast Date: Wed, 28 Jan 2026 23:12:47 +0000 Subject: [PATCH 1/4] Update user_fx to include installation instructions and a usermod config example --- usermods/user_fx/README.md | 6 ++++++ usermods/user_fx/user_fx.cpp | 23 +++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/usermods/user_fx/README.md b/usermods/user_fx/README.md index 704b71df01..d9660d8df2 100644 --- a/usermods/user_fx/README.md +++ b/usermods/user_fx/README.md @@ -4,6 +4,7 @@ This usermod is a common place to put various users’ WLED effects. It lets you Multiple Effects can be specified inside this single usermod, as we will illustrate below. You will be able to define them with custom names, sliders, etc. as with any other Effect. +* [Installation](./README.md#installation) * [How The Usermod Works](./README.md#how-the-usermod-works) * [Basic Syntax for WLED Effect Creation](./README.md#basic-syntax-for-wled-effect-creation) * [Understanding 2D WLED Effects](./README.md#understanding-2d-wled-effects) @@ -14,6 +15,11 @@ Multiple Effects can be specified inside this single usermod, as we will illustr * [Change Log](./README.md#change-log) * [Contact Us](./README.md#contact-us) +## Installation + +To activate the usermod, add the following line to your platformio_override.ini +`custom_usermods = user_fx` + ## How The Usermod Works The `user_fx.cpp` file can be broken down into four main parts: diff --git a/usermods/user_fx/user_fx.cpp b/usermods/user_fx/user_fx.cpp index da6937c87d..2c9e2339f5 100644 --- a/usermods/user_fx/user_fx.cpp +++ b/usermods/user_fx/user_fx.cpp @@ -8,6 +8,10 @@ static uint16_t mode_static(void) { return strip.isOffRefreshRequired() ? FRAMETIME : 350; } +// If you define configuration options in your class and need to reference them in your effect function, add them here. +// If you only need to use them in your class you can define them as class members instead. +// bool myConfigValue = false; + ///////////////////////// // User FX functions // ///////////////////////// @@ -109,6 +113,25 @@ class UserFxUsermod : public Usermod { // strip.addEffect(255, &mode_your_effect2, _data_FX_MODE_YOUR_EFFECT2); // strip.addEffect(255, &mode_your_effect3, _data_FX_MODE_YOUR_EFFECT3); } + + + /////////////////////////////////////////////////////////////////////////////////////////////// + // If you want configuration options in the usermod settings page, implement these methods // + /////////////////////////////////////////////////////////////////////////////////////////////// + + // void addToConfig(JsonObject& root) override + // { + // JsonObject top = root.createNestedObject(FPSTR("User FX")); + // top["myConfigValue"] = myConfigValue; + // } + // bool readFromConfig(JsonObject& root) override + // { + // JsonObject top = root[FPSTR("User FX")]; + // bool configComplete = !top.isNull(); + // configComplete &= getJsonValue(top["myConfigValue"], myConfigValue); + // return configComplete; + // } + void loop() override {} // nothing to do in the loop uint16_t getId() override { return USERMOD_ID_USER_FX; } }; From e2e3afa0effb9245cee3ff12fd3fac35ce7291ad Mon Sep 17 00:00:00 2001 From: gustebeast Date: Wed, 4 Feb 2026 18:45:03 +0000 Subject: [PATCH 2/4] Explain installation when using multiple usermods --- usermods/user_fx/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/usermods/user_fx/README.md b/usermods/user_fx/README.md index d9660d8df2..3fe7539062 100644 --- a/usermods/user_fx/README.md +++ b/usermods/user_fx/README.md @@ -19,6 +19,8 @@ Multiple Effects can be specified inside this single usermod, as we will illustr To activate the usermod, add the following line to your platformio_override.ini `custom_usermods = user_fx` +Or if you are already using a usermod, append user_fx to the list +`custom_usermods = audioreactive, user_fx` ## How The Usermod Works From 2e5cf63e912184baee02ddac3dcfde481a117063 Mon Sep 17 00:00:00 2001 From: gustebeast Date: Wed, 4 Feb 2026 18:45:03 +0000 Subject: [PATCH 3/4] Explain installation when using multiple usermods --- usermods/user_fx/README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/usermods/user_fx/README.md b/usermods/user_fx/README.md index 3fe7539062..b249c5da16 100644 --- a/usermods/user_fx/README.md +++ b/usermods/user_fx/README.md @@ -18,9 +18,13 @@ Multiple Effects can be specified inside this single usermod, as we will illustr ## Installation To activate the usermod, add the following line to your platformio_override.ini -`custom_usermods = user_fx` +```ini +custom_usermods = user_fx +``` Or if you are already using a usermod, append user_fx to the list -`custom_usermods = audioreactive, user_fx` +```ini +custom_usermods = audioreactive, user_fx +``` ## How The Usermod Works From 986d0726f56bd033f775221f2db4fcb1469bc79c Mon Sep 17 00:00:00 2001 From: gustebeast Date: Thu, 5 Feb 2026 18:19:59 +0000 Subject: [PATCH 4/4] Remove comma from multiple usermod example --- usermods/user_fx/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usermods/user_fx/README.md b/usermods/user_fx/README.md index b249c5da16..83ba3737ca 100644 --- a/usermods/user_fx/README.md +++ b/usermods/user_fx/README.md @@ -23,7 +23,7 @@ custom_usermods = user_fx ``` Or if you are already using a usermod, append user_fx to the list ```ini -custom_usermods = audioreactive, user_fx +custom_usermods = audioreactive user_fx ``` ## How The Usermod Works