Menu widget instead of just go to the next patern with pushing the preset button

Hello i use this project. But i wanted to use the Menu widget instead of just go to the next patern with pushing the preset button.
I am a really big noob and just getting into this. So maybe what i say will sound stupid, but hey
we’ve all been there. I geuss.
Also i would like it that you can adjust the brightness of a pattern with the brightness slider. This is because sometimes i want it just to be darker or brighter. Possible??

I used the project from the link with the latest code.

SO how to use this code

BLYNK_WRITE(V1) {
  switch (param.asInt())
  {
    case 1: // Item 1
      Serial.println("Item 1 selected");
      break;
    case 2: // Item 2
      Serial.println("Item 2 selected");
      break;
    case 3: // Item 3
      Serial.println("Item 3 selected");
      break;
    default:
      Serial.println("Unknown item selected");
  }
}

With those things?

 BLYNK_WRITE(vPIN_PRESET) {
  if (varZone == ZONE || varZone == 1 && param.asInt()) nextPattern();



   FastLED.show();
 }
 /****************************************************************************/
 #define ARRAY_SIZE(A) (sizeof(A) / sizeof((A)[0]))
 
 void nextPattern() {
   gCurrentPatternNumber = (gCurrentPatternNumber + 1) % ARRAY_SIZ
 void rainbow() {
   // FastLED's built-in rainbow generator
   fill_rainbow( leds, LED_NUMBER, gHue, varRainbowSpeed);
   Blynk.virtualWrite(vPIN_BRIGHTNESS, varBrightness);
   FastLED.delay(1000 / varSpeed);
 }
 
 void rainbowWithGlitter() {
   // built-in FastLED rainbow, plus some random sparkly glitter
   rainbow();
   addGlitter(80);
 }
 
 void addGlitter( fract8 chanceOfGlitter) {
   if ( random8() < chanceOfGlitter) leds[ random16(LED_NUMBER) ] += CRGB::White;
   FastLED.delay(1000 / varSpeed);
 }
 
 void confetti() {
   // random colored speckles that blink in and fade smoothly
   fadeToBlackBy( leds, LED_NUMBER, 10);
   int pos = random16(LED_NUMBER);
   leds[pos] += CHSV( gHue + random8(64), 200, 255);
   FastLED.delay(1000 / varSpeed);
 }
 
 void sinelon() {
   // a colored dot sweeping back and forth, with fading trails
   fadeToBlackBy( leds, LED_NUMBER, 20);
   int pos = beatsin16(13, 0, LED_NUMBER);
   leds[pos] += CHSV( gHue, 255, 192);
   FastLED.delay(1000 / varSpeed);
 }
 
 void juggle() {
   // eight colored dots, weaving in and out of sync with each other
   fadeToBlackBy( leds, LED_NUMBER, 20);
   byte dothue = 0;
   for ( int i = 0; i < 8; i++) {
     leds[beatsin16(i + 7, 0, LED_NUMBER)] |= CHSV(dothue, 200, 255);
     dothue += 32;
   }
   FastLED.delay(1000 / varSpeed);
 }

As that topic you were referring to is getting older and the OP has not been around, and your issue is more to do with “how to write code” I moved your post into your own topic. I also properly formatted your posted code as per the Welcome Topic.

O sorry but thanks. I did not read the welcome post to be honest :innocent: Now it is my own topic I’ve changed some thing in te post and title

1 Like

2 posts were split to a new topic: Having some problems with compiling