Hello, I am making a program when you push a physical button, you get a notification on your smartphone. I wrote this program:
var Blynk = require(’/usr/local/lib/node_modules/blynk-library’);
var Gpio = require(‘onoff’).Gpio;
var AUTH = ‘b6216e4b56964600ba05627ddc003dbf’;var button = new Gpio(18, ‘in’);
var blynk = new Blynk.Blynk(AUTH);
var v6 = new blynk.VirtualPin(6);
button.on(‘write’, function(param) {
if (param == 1) {blynk.notify(“Deksel open”);}
});
but when I try it it gives me this error:
/ _ )/ /_ _____ / /__
/ _ / / // / _ / '/
///_, /////_
/__/Give Blynk a Github star! => https://github.com/vshymanskyy/blynk-library-js
OnOff mode
Connecting to: blynk-cloud.com 9443
/home/pi/test-project/program.js:13
button.on(‘write’, function(param) {
^TypeError: button.on is not a function
at Object. (/home/pi/test-project/program.js:13:8)
at Module._compile (module.js:652:30)
at Object.Module._extensions…js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Function.Module.runMain (module.js:693:10)
at startup (bootstrap_node.js:188:16)
at bootstrap_node.js:609:3
Is there someone that nows the correct way to program with Gpio pins?