Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to cycle all the FXes and Pallettes and intensities and speeds in a random way? #324

Closed
l0c0luke opened this issue Nov 5, 2019 · 3 comments
Labels
stale This issue will be closed soon because of prolonged inactivity

Comments

@l0c0luke
Copy link

l0c0luke commented Nov 5, 2019

I am spending hours playing with the combos and I find they are all amazing. So instead of creating presets and cycling through them all to get a random experience, is there a way to just let the luck of the draw happen?

@sansillusion
Copy link

sansillusion commented Nov 5, 2019 via email

@recliq
Copy link
Contributor

recliq commented Jan 9, 2020

What about a small UserProgram...
wled06_usermod.ino:

 * This file allows you to add own functionality to WLED more easily
 * See: https://github.com/Aircoookie/WLED/wiki/Add-own-functionality
 * EEPROM bytes 2750+ are reserved for your custom use case. (if you extend #define EEPSIZE in wled01_eeprom.h)
 * bytes 2400+ are currently ununsed, but might be used for future wled features
 */

//Use userVar0 and userVar1 (API calls &U0=,&U1=, uint16_t)

long lastTime;
int delayMs;

//gets called once at boot. Do all initialization that doesn't depend on network here
void userSetup()
{
    userVar0 = 0;
    userVar1 = 0;
    lastTime = 0;
    delayMs = 0;
}

//gets called every time WiFi is (re-)connected. Initialize own network interfaces here
void userConnected()
{

}

//loop. You can use "if (WLED_CONNECTED)" to check for successful connection
void userLoop()
{
    delayMs = userVar0 * 1000;

    if (delayMs > 0 && millis() - lastTime > delayMs)
    {
        lastTime = millis();
        userVar1 = 1;
    }

    if (userVar1 > 0)
    {
        effectCurrent = random8(0, strip.getModeCount() - 1);
        effectSpeed = random8(0, 255);
        effectIntensity = random8(0, 255);
        effectPalette = random8(0, strip.getPaletteCount() - 1);
        colorUpdated(1);
        userVar1 = 0;
    }
}

Set &U0=<seconds> to randomize the effects periodically each x seconds or 0 to disable,
set &U1= 1 to trigger randomize effect once.
You maybe also want to limit the value range for speed and intensity...

@stale
Copy link

stale bot commented May 8, 2020

Hey! This issue has been open for quite some time without any new comments now. It will be closed automatically in a week if no further activity occurs.
Thank you for using WLED!

@stale stale bot added the stale This issue will be closed soon because of prolonged inactivity label May 8, 2020
@stale stale bot closed this as completed May 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale This issue will be closed soon because of prolonged inactivity
Projects
None yet
Development

No branches or pull requests

3 participants