vshymanskyy / blynk-library-js

Blynk library for JS. Works with Browsers, Node.js, Espruino.
https://blynk.io/
MIT License
215 stars 67 forks source link

Easier way to declare a virtualpin in nodejs? #24

Open ngohuunam opened 7 years ago

ngohuunam commented 7 years ago

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.

vshymanskyy commented 7 years ago

Any ideas?

BLavery commented 7 years ago

Try:

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