Hello i want to insert delay time between the gpio pin but when i pres V1 appears this error on terminal.
how to put the proper command delay time
var Blynk = require('blynk-library');
var Gpio = require('onoff').Gpio;
var led1 = new Gpio(27, 'out');
var led2 = new Gpio(18, 'out');
var led3 = new Gpio(17, 'out');
var AUTH = 'e3bacfb60e0b4305854082b499cc2df9';
var blynk = new Blynk.Blynk(AUTH);
var v1 = new blynk.VirtualPin(1);
v1.on('write', function(param) {
if (param[0] == '1') {
led1.writeSync(1);
2000
led1.writeSync(0);
1000
led2.writeSync(1);
1000
led2.writeSync(0);
1000
led3.writeSync(1);
1000
led3.writeSync(0);
}else{
led1.writeSync(1);
2000
led1.writeSync(0);
}
console.log('V1:', param[0]);
});
Give Blynk a Github star! => https://github.com/vshymanskyy/blynk-library-js
OnOff mode
Connecting to: blynk-cloud.com 443
SSL authorization...
Connected
Authorized
/home/pi/my-awesome-project/index2.js:22
delay (2000) ;
^
ReferenceError: delay is not defined
at Blynk.VirtualPin.<anonymous> (/home/pi/my-awesome-project/index2.js:22:5)
at emitOne (events.js:116:13)
at Blynk.VirtualPin.emit (events.js:211:7)
at Blynk.onReceive (/home/pi/my-awesome-project/node_modules/blynk-library/blynk.js:510:27)
at exports.SslClient.<anonymous> (/home/pi/my-awesome-project/node_modules/blynk-library/blynk.js:607:50)
at emitOne (events.js:116:13)
at exports.SslClient.emit (events.js:211:7)
at TLSSocket.<anonymous> (/home/pi/my-awesome-project/node_modules/blynk-library/blynk-node.js:212:16)
at emitOne (events.js:116:13)
at TLSSocket.emit (events.js:211:7)