Widget code not working properly

Hi everyone. I am working on a Valentine’s day gift for my girlfriend. It’s a 3d printed heart with dotstar leds around it and a 3d printed base that houses an arduino and a breadboard with an HC-06 BT module, that also has a strip of dotstar leds wrapped around it. I was looking around for the most User friendly design to help her edit the leds because she isn’t really computer savvy and instead of having her send console commands, I wanted to use blynk. However, I am a real beginner when it comes to programming and not being able to see how blynk functions work and having clear documentation on everything is making it really difficult to troubleshoot my program.

What I currently have written allows me to turn the LEDs on and off with buttonV1, and change the light mode with a menu widget on V0. I also have a brightness slider set to V2, a saturation slider on V6 and a ZERGBA widget on V3.

As you can tell, though, this code is nowhere near complete yet. My current hitches in continuing developing my code are:

I have enough power based on the math, yet the leds on the heart do weird things during the rainbow mode at high brightness(some of them don’t light, and the others are random colors) and blink mode blinks red like it should, but the heart leds blink red, kinda flicker blue, then go black.

BLYNK_APP_CONNECTED isn’t called when the app connects to the arduino.

Brightness slider on v2 reads the pinValue, but only changes the brightness when the light effect mode is set to rainbow from the menu widget. If I just press buttonV1 to turn it on(into what is essentially the initial, default mode the leds come to when you turn them on), then change the brightness, the leds just turn off.

The ZERGBA widget isn’t changing the redValue, greenValue, and blueValue ints(it looks like the zeRGBa isn’t even calling BLYNK_WRITE(V3) like it’s supposed to), so when I try to set solid color in the light effects menu, the leds turn off because it sets them to 0,0,0. A lot of the time i touch the zergba, it says, “your app is outdated, please update.” at the bottom, although I have the latest version of the app.

#include <Blynk.h>
#include <SPI.h>
#include <Ethernet.h>
#include <BlynkSimpleSerialBLE.h>
#include <bitswap.h>
#include <chipsets.h>
#include <color.h>
#include <colorpalettes.h>
#include <colorutils.h>
#include <controller.h>
#include <cpp_compat.h>
#include <dmx.h>
#include <FastLED.h>
#include <fastled_config.h>
#include <fastled_delay.h>
#include <fastled_progmem.h>
#include <fastpin.h>
#include <fastspi.h>
#include <fastspi_bitbang.h>
#include <fastspi_dma.h>
#include <fastspi_nop.h>
#include <fastspi_ref.h>
#include <fastspi_types.h>
#include <hsv2rgb.h>
#include <led_sysdefs.h>
#include <lib8tion.h>
#include <noise.h>
#include <pixelset.h>
#include <pixeltypes.h>
#include <platforms.h>
#include <power_mgt.h>
#include <SoftwareSerial.h>

template<class T> inline Print &operator <<(Print &obj, T arg) {
  return obj;

/*********************************constants and variables*******************************/

#define HEART_NUM_LEDS 35
#define BASE_NUM_LEDS 30
#define DATA_PIN1 4
#define CLOCK_PIN1 5
#define DATA_PIN2 8
#define CLOCK_PIN2 9

SoftwareSerial SerialBLE(10, 11); // RX, TX

//CRGB allLeds[65];
CRGBArray<65> allLeds;

char auth[] = "3f0966b595c34180a202553d7fd61675";
byte onPinData = 0;
int modeState = 0;
int menuState = 0;

int previousBrightness;
int brightnessValue = 1;
int redValue = 255;
int greenValue = 0;
int blueValue = 0;

int activeLeds = 0;

float ihue = 0;
float istep = 0.01;
int idelay = 0;
int numstops = 0;

/************************************Blynk Functions************************************/

WidgetLCD lcd(V4);

  Serial.println("App is connected. Syncing pins.");
  Blynk.syncVirtual(V1, V0, V2, V6, V3);

  lcd.print(0, 0, "Welcome back!");

BLYNK_WRITE(V1) //Button Widget is writing to pin V1
  onPinData = param.asInt();
  Serial.print("button is writing to virtual pin 1: ");

  if (onPinData == 1) {
    modeState = 1;
  } else if (onPinData == 0) {
    modeState = 0;

BLYNK_WRITE(V0) //light effect Menu widget is writing to pin
  int pinValue = param.asInt();
  menuState = pinValue;


BLYNK_WRITE(V2) //Brightness Slider is writing to pin 2
  Serial.println("brightness slider is moving");

  int pinValue = param.asInt(); // assigning incoming value from pin V1 to a variable
  brightnessValue = pinValue;

BLYNK_WRITE(V6) //saturation Slider is writing to pin 6
  //int pinValue = param.asInt(); // assigning incoming value from pin V1 to a variable


BLYNK_WRITE(V3) //ZERGBA is writing to pin 3
  Serial.println("ZERGBA is writing to pin 3");

  redValue = param[0].asInt(); // assigning incoming value from pin V1 to a variable
  greenValue = param[1].asInt();
  blueValue = param[2].asInt();
  Serial << "values are: " << redValue << " " << greenValue << " " << blueValue;

/*********************************Arduino Setup*****************************************/

void setup() {
  //FastLED.addLeds<APA102, DATA_PIN1, CLOCK_PIN1, BGR>(heartLeds, HEART_NUM_LEDS);
  //FastLED.addLeds<APA102, DATA_PIN2, CLOCK_PIN2, BGR>(baseLeds, BASE_NUM_LEDS);
  FastLED.addLeds<APA102, DATA_PIN1, CLOCK_PIN1, BGR>(allLeds, 0, 35);
  FastLED.addLeds<APA102, DATA_PIN2, CLOCK_PIN2, BGR>(allLeds, HEART_NUM_LEDS, 30);


  Blynk.begin(SerialBLE, auth);

  lcd.print(0, 0, "Hi, Alley!");


/**************************************Ardino Loop**************************************/

void loop() {
  // put your main code here, to run repeatedly:

  switch (modeState) {
    case 0: //if modeState is set to off

      for (CRGB & pixel : allLeds) {
        CRGB(0, 0, 0);

      lcd.print(0, 0, "The lights are  off");

      activeLeds = 0;
      Serial.print("number of active leds are: ");
    case 1: // if modeState is set to on

      lcd.print(0, 0, "The lights are  on");

      activeLeds = 65;
      Serial.print("number of active leds are: ");

      if(brightnessValue != previousBrightness) {
        Serial << "brightness is: " << brightnessValue;

        lcd.print(0, 0, "Brightness is:");
        lcd.print(0, 1, brightnessValue);
        brightnessValue = previousBrightness;

      switch (menuState) {
        case 1: // solid

          lcd.print(0, 0, "Selected:");
          lcd.print(0, 1, "soild color");

            for (CRGB & pixel : allLeds) {
              pixel = CRGB(redValue, greenValue, blueValue);

              Serial << "led " << pixel << " is set to : " << redValue << "," << greenValue << "," << blueValue;
        case 2: // rainbow

          lcd.print(0, 0, "Selected:");
          lcd.print(0, 1, "Rainbow");


          numstops = round(255 / activeLeds);

          for (int led = 0; led < 65; led++) {
            allLeds[led] = CHSV(led * numstops + ihue, 255, 255);
            ihue += istep;
            if (ihue >= 255) {
              ihue = 0;

        case 3: // blink

          lcd.print(0, 0, "Selected:");
          lcd.print(0, 1, "Blink");

          //for(int i = 0; i < 65; i++) {
          for (CRGB & pixel : allLeds) {
            pixel = CRGB::Red;
          for (CRGB & pixel : allLeds) {
            pixel = CRGB::Black;

        case 4: //fade

          lcd.print(0, 0, "Selected:");
          lcd.print(0, 1, "Fade");
        case 5: //scan

        case 6: //cross

          for (CRGB & pixel : allLeds) {
            CRGB(redValue, greenValue, blueValue);