Help me shorten this code (Array of virtual pins)

HI!
Is there a way to make this shorter?

digitalWrite (RelayPin, LOW) ;
** Blynk.virtualWrite(V8, LOW);**
** Blynk.virtualWrite(V7, LOW);**
** Blynk.virtualWrite(V6, LOW);**
** Blynk.virtualWrite(V5, LOW);**
** Blynk.virtualWrite(V4, LOW);**
** Blynk.virtualWrite(V3, LOW);**
** Blynk.virtualWrite(V2, LOW);**
** Blynk.virtualWrite(V1, LOW);**

I have tried various vesrion of this and I gues there must be a solution?
digitalWrite (RelayPin, LOW) ;
Blynk.virtualWrite((V1, V2, V3, V4, V5, V6, V7, V8), LOW);

Any sugestions?

No, this is not possible at the moment.
You can use loop

for (int p = V1; p <= V8; p++) {
  Blynk.virtualWrite(p, LOW);
}

It will still send N commands

1 Like

OK thank you, maybe a funktion for the future :smiley: