BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

Blinking styled widget


#1

styled button provide issue when I have more than 4 blinking buttons.

Blynk.setProperty(Vx, “onBackColor”, color);

process freeze until I reset nodeMCU
so I have to forget this design :disappointed_relieved::disappointed_relieved:

Video_00250


#2

Now it’s solved ! :smile:

Video_00251

int Step=0;
.
.
.
timer.setInterval(200, Blinkbutton);

.
.
.

void Blinkbutton() {

  if (Step == 9) {
    Step = 0;
  }

  Step++;

    switch (Step) {
      case 1:
        if (BTN1 == true) {
          if (F1 == 1) {
            Blynk.setProperty(V1, "onBackColor", DARK_RED);
            F1 = 0;
          } else {
            Blynk.setProperty(V1, "onBackColor", DARK_GREEN);
            F1 = 1;
          }
        }
        break;

      case 2:
        if (BTN2 == true) {
          if (F2 == 1) {
            Blynk.setProperty(V2, "onBackColor", DARK_RED);
            F2 = 0;
          } else {
            Blynk.setProperty(V2, "onBackColor", DARK_GREEN);
            F2 = 1;
          }
        }
        break;

      case 3:
        if (BTN3 == true) {
          if (F3 == 1) {
            Blynk.setProperty(V3, "onBackColor", DARK_RED);
            F3 = 0;
          } else {
            Blynk.setProperty(V3, "onBackColor", DARK_GREEN);
            F3 = 1;
          }
        }
        break;

      case 4:
        if (BTN4 == true) {
          if (F4 == 1) {
            Blynk.setProperty(V4, "onBackColor", DARK_RED);
            F4 = 0;
          } else {
            Blynk.setProperty(V4, "onBackColor", DARK_GREEN);
            F4 = 1;
          }
        }
        break;

      case 5:
        if (BTN5 == true) {
          if (F5 == 1) {
            Blynk.setProperty(V5, "onBackColor", DARK_RED);
            F5 = 0;
          } else {
            Blynk.setProperty(V5, "onBackColor", DARK_GREEN);
            F5 = 1;
          }
        }
        break;

      case 6:
        if (BTN6 == true) {
          if (F6 == 1) {
            Blynk.setProperty(V6, "onBackColor", DARK_RED);
            F6 = 0;
          } else {
            Blynk.setProperty(6, "onBackColor", DARK_GREEN);
            F6 = 1;
          }
        }
        break;

      case 7:
        if (BTN7 == true) {
          if (F7 == 1) {
            Blynk.setProperty(V7, "onBackColor", DARK_RED);
            F7 = 0;
          } else {
            Blynk.setProperty(V7, "onBackColor", DARK_GREEN);
            F7 = 1;
          }
        }
        break;

      case 8:
        if (BTN8 == true) {
          if (F8 == 1) {
            Blynk.setProperty(V8, "onBackColor", DARK_RED);
            F8 = 0;
          } else {
            Blynk.setProperty(V8, "onBackColor", DARK_GREEN);
            F8 = 1;
          }
        }
        break;
    }
}

#3

Hehe… your issue wasn’t a Blynk problem… just “too much too fast” causing disconnection.

Interesting results… I will add this to my “weird things to do with Blynk” studies :+1:


#4

yes Gunner,
it’s not realy a blynk issue.
but there’s no issue with virtual LEDs.
I tried with different timers.
1000, 2000 , 3000, same issue when there is more than 4 styled buttons.
I assume it’s due to short delay between each blynk instructions. so it’s not possible to blink more than 4 buttons at same time.

try it and forward me your experience.