Hello, This is my first time here on Blynk, I’m creating a project using Raspberry Pi2, Blynk iPhone App. I’m running blynk script using node. Everything is working fine except when I try to turn on LED using virtual pin on App using the following script. As soon I run the script with below line I’m getting error. How to turn on/off led widget using script in raspberry pi? Thank you for your help!
var vD1OpenLED = new blynk.WidgetLED(64);
^
TypeError: undefined is not a function
at Object. (/home/pi/GarageDoors.js:25:18)
at Module._compile (module.js:460:26)
at Object.Module._extensions…js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
at node.js:814:3
I’d like to bump this. Is there any documentation on how to use each widget in js? I’m completely new to nodejs but apart from the 1 example here https://github.com/vshymanskyy/blynk-library-js, I haven’t been able to find anything else.
Thanks for that, that’s really useful. I tried to put it to use
var blynkLib = require('/usr/local/lib/node_modules/blynk-library'),
var AUTH = 'xxxxxxxxx';
var blynk = new blynkLib.Blynk(AUTH);
var v2 = new blynk.WidgetLED(2); //power led
v2.turnOn();
I’m not sure what I’m doing wrong. The led does not light up on the app when I run the code.