Add user_fx installation instructions and a usermod config example (#5327)

* Update user_fx to include installation instructions and a usermod config example
* Explain installation when using multiple usermods
This commit is contained in:
gustebeast
2026-02-05 22:16:25 -08:00
committed by GitHub
parent c64b1e3e5d
commit 0120b1ab79
2 changed files with 35 additions and 0 deletions

View File

@@ -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; }
};