[Solved] Need help with Blynk on Raspberry Pi B revision 2

I am trying to use the button widget to turn on 3 LEDs individually. The LEDs are connected to GPIO pins 4, 17, and 27. There is little information on the node.js version of Blynk, so I am confused.

Here is my code:
var Blynk = require('blynk-library') var AUTH = "xxxxxxxxxxxxxxxxxxxxxxxx" var blynk = new Blynk.Blynk(AUTH); var gp4 = new blynk.DigitalPin(4); var gp17 = new blynk.DigitalPin(17); var gp27 = new blynk.DigitalPin(27);

When I run the code with node this is the error message I get:
var gp4 = new blynk.DigitalPin(4); ^ TypeError: undefined is not a function at Object.<anonymous> (/home/pi/Documents/Blynk/ledCloud.js:5:11) 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

why do you think you need to write DigitalPin? You need to write code only for virtual pins -> digital pins work out of the box.
You just need to install onoff nodejs module on Raspberry Pi.

1 Like

Thanks for you help @vshymanskyy. I got the Raspberry Pi to work.