blynk-library-js icon indicating copy to clipboard operation
blynk-library-js copied to clipboard

Easier way to declare a virtualpin in nodejs?

Open ngohuunam opened this issue 8 years ago • 2 comments

As normal, I declare a Virtualpin like your example: var v1 = new blynk.VirtualPin(1); If I have "some" virtualpin, it's fine, but in case of many pins, about 40 - 50 pin? Is there any way to more quick and easier to declare a virtual pin instead of write 40 - 50 lines ? I know this is personal question, but hope you can help me.

ngohuunam avatar Nov 15 '16 04:11 ngohuunam

Any ideas?

vshymanskyy avatar Mar 06 '17 11:03 vshymanskyy

Try:

for (v=0; v<=30; v++) eval("var V" + v + " = new blynk.VirtualPin(" + v + ");");

BLavery avatar May 02 '17 10:05 BLavery