Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions usermods/user_fx/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -14,6 +15,17 @@ 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
```ini
custom_usermods = user_fx
```
Or if you are already using a usermod, append user_fx to the list
```ini
custom_usermods = audioreactive user_fx
```

## How The Usermod Works

The `user_fx.cpp` file can be broken down into four main parts:
Expand Down
23 changes: 23 additions & 0 deletions usermods/user_fx/user_fx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 //
/////////////////////////
Expand Down Expand Up @@ -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; }
};
Expand Down