Run 8 Pumps From Blynk

As Costas mentioned, you can skip the WidgetLED object.

Widget Leds have two states, a value of 0 equals off and 1 equals on, therefore you need no other interaction or special code other than doing a virtual write on desired led.

You need a way to store your “array of leds”, This you did fine ealier but you need to save it as an array of integers because that is what the virtual pin references are defined as.

int dosingLEDs[8]  = { V14, V15, V16, V17, V18, V19, V20, V21 };

Then just find your appropriate places in code to add

Blynk.virtualWrite(dosingLEDs[x], 1)  // for on
Blynk.virtualWrite(dosingLEDs[x], 0)  // for off

When you want it to turn on/off

2 Likes