Zergba and FastLED for blynk ios app

Hello everyone.
I have the Blynk application on IOS and I want to use the zergba widget. According to the documentation, you have to use a string datastream when you want to use the merge mode.
However, when I want to choose the datastream, I am only offered integers datastreams. I have looked in old posts and I saw that only the IOS version had this problem. I would like to know when this issue will be fixed. If not what are the other solutions to use the zergba wigdet with a led strip and the FastLED library.

Thank for your understanding.

Hello, @Babacar

Please share a link to the documentation.

According docs ZeRGBa widget supportes integer datastream Widgets (app) - Blynk Documentation

@Babacar is referring to Advanced (Merge) mode.

The three values should be sent from the widget as a string array, but this is a bug in the iOS app as it doesn’t allow string datastream types to be selected.

@Eugene - one for you?

Pete.

Same problem in Android. No abtility choose stings datastream.

Possibly an error in the documentation. Need to be clarified

It’s possible.

Thank you. Only in Advanced mod

Yes. In iOS “Advanced” mode is known as “Merge” and you can’t choose a string data type.

If you re-read the original post this is the error that is being described.

Pete.

Reproduced in iOS. Provided information to the iOS developer.

Thanks for your replies, I need to know how this issue can be fixed with the split mode ?

In split mode, each of the parameters will be sent to a separate virtual pin instead of sending them all to the same virtual pin, so you can send the red color value to V1 for example, and use the BLYNK_WRITE() function to retrieve the value from the server. Something like this

BLYNK_WRITE(V1) // zeRGBa assigned to V1 
{
    // get a RED channel value
    int Red = param.asInt();
    Serial.println(Red);
}

Ok, I understand thank you for your help. Can I use this mode with the FastLED librairy ?

Yes.
Both modes are the same. The only difference between the two modes is the way they output data. Split mode outputs a single parameter, while merge mode outputs one message consisting of an array of values.

You can, but there are a few drawbacks.
It now requires 3 datastreams rather than 1, and this might be an issue if you are approaching the datastream limit for your plan.

Also, if you previously had one BLYNK_WRITE(vPin) function to handle all of the RGB commands you will now need three - one each for Red, Green and Blue.
You’ll probably need to have global rather than local variables for R, G & B and put your FastLED code in a function that is called whenever one of the three BLYNK_WRITE(vPin) functions for your ZeRGBa widget is triggered.

Pete.

It’s something like this ?

CRGB leds[NUM_LEDS]; 

BLYNK_WRITE(V1)
{
  int red = param.asInt();
}

BLYNK_WRITE(V2)
{
  int green = param.asInt();
}

BLYNK_WRITE(V3)
{
  int blue = param.asInt();
}

void setup()
{
  Serial.begin(115200);
  delay(100);
  FastLED.addLeds<WS2812B, RING_PIN, GRB>(leds, NUM_LEDS);     
  FastLED.setBrightness(50);                 

  BlynkEdgent.begin();
}

void loop() {
  BlynkEdgent.run();
  fill_solid(leds, NUM_LEDS, CRGB(red, green, blue));
  FastLED.show();
  
}

That makes the values local, not global.

I would have expected this to be in a function called by each of your BLYNK_WRITE(vPin) functions, and you’ll probably need a BLYNK_CONNECTED() function with Blynk.syncVirtual(vPin) commands for each of your virtual pins.

Pete.

Ok I’ll try to make this. Thank you.

If I understand correctly. This is the code.

CRGB leds[NUM_LEDS]; 

BLYNK_WRITE(V1)
{
  int red = param.asInt();
}

BLYNK_WRITE(V2)
{
  int green = param.asInt();
}

BLYNK_WRITE(V3)
{
  int blue = param.asInt();
}

BLYNK_CONNECTED()
{
  int RED = Blynk.syncVirtual(V1);
  int GREEN = Blynk.syncVirtual(V2);
  int BLUE = Blynk.syncVirtual(V3);
  fill_solid(leds, NUM_LEDS, CRGB(RED, GREEN, BLUE));
  FastLED.show();
  
}

No, not at all.

Placing “int” in front of a variable name declares it. This should be done once only, near the top of the code if you want global variables (which you do).

This…

Is the incorrect syntax, it’s simply…

Blynk.syncVirtual(V1);

And you still haven’t put your FastLED code in a function and called it from each of your BLYNK_WRITE(vPin) functions.

Pete.

Is it possible to give me an example so that I can understand how the functions work please ?

int red;

BLYNK_WRITE(V1)
{
  red = param.asInt();
}