Change color in app with Blynk2.0

Hi there,

In Blynk version 2.0, why in the app I can’t change led colors (ON/OFF), gauge color dimming? Is this an upcoming improvement?

Thanks in advance

Steve

The LED On colour is set in the datastream now. Off colour seems to be set to black. It is possible to change these from your sketch, using the setProperty command.

I don’t understand what Gauge colour dimming means.

Once again, more info is required in what “unable to order or display anything” means in practice. I guess screenshots may help?

Pete.

I tried with setProperty but nothing changed. Like here in my code

void loop()
{
  Blynk.run();
  timer.run();

  if (digitalRead(bouttonPin) == HIGH) {
    Blynk.virtualWrite(VPIN_BOUTTON, HIGH);
    Blynk.setProperty(V2, "color", "#23C48E");
    boutton = HIGH;
  }
  else {
    Blynk.virtualWrite(VPIN_BOUTTON, LOW);
    Blynk.setProperty(V2, "color", "#D3435C");
    boutton = LOW;
  }

}

what i meant by color gradation is that the color changes depending on the value (google translation error)

Finally the link with the web page is operational again

Please don’t run this code, it breaks the golden rule of Blynk which is to never have Blynk.virtualWrites or similar commands such as Blynk.setProperty in your void loop.

Your sketch will flood the Blynk server with commands.

Pete.

Ok I understand what you are saying. I changed my code.

But by not putting Blynk.virtualWrite in the main loop, with a refresh rate of 10 seconds, if I have an input coming in, it will only be updated every 10 seconds. I would like to see this entry first. What advice then? decrease the loop by 10 seconds?

I managed to change the color of the led but only when it is in the high state. I can’t change the low state which remains white.

The sensible thing to do would be to trigger the colour change once only, when the incoming value changes.

How you do that depends on what your project is all about, and what the rest of your code looks like.

One option with the LED is to leave it in the ON state all of the time, and change it’s colour to meet your needs.

Pete.