Hi guy’s another question from a starting noob that not can write a decent line of code (but got a good understanding how this project works)
I’am moddifying a excisting project and want when i push a button in blynk it will use the addGlitter function/pattern with the current playing pattern. But i can’t get it to work.
------------------I want something like if i push the button:----------------------------
BLYNK_WRITE(vPIN_ADD_GLITTER) {
param.asInt = addGlitters1();
}
-----------It will say hey play the current pattern number and add those glitters----------
void glitters() {
gCurrentPatternumber();
addGlitter(80);
}
-------------------------------addGlitter function--------------------------------
void addGlitter( fract8 chanceOfGlitter) {
if (random8() < chanceOfGlitter) leds[ random16(LED_NUMBER) ] += CRGB::White;
delay(1000 / varGlitterSpeed); //not sure if varGlitterSpeed will work because i the glitter function is not working right right now
}
I also tried to make a glitter list so i had
gCurrentPatterNumber and gCurrentGlitterNumber that may work together.
---------------So i thought i had to copy somethine like this------------------
typedef void (*SimplePatternList[])();
SimplePatternList gPatterns = { rainbow, confetti, sinelon, juggle};
uint8_t gCurrentPatternNumber = 0; // Index number of which pattern is current
uint8_t gHue = 0; // rotating “base color” used by many of the patterns
-------------------------------And add this----------------------------------------------
typedef void (*GlitterList[])();
GlitterList gGlitters = {glitter};
int gCurrentGlitterNumber = 0;
As if you can geuss this did not work for me, as many other thing i tried (keep in mind i can’t write real lines of code).
So i hope someone has a great tip or just want to write edit the code for me?