Im using an Raspberry Pi 3B+.
Hello everybody, im trying “klick” a button, without tapping.
So I have 3 virtual pins and 3 buttons(connected to the pins) on my Iphone which can switch between 0 and 1.
Im using the first and the second button to turn on or off my lamps (433 MHz Transmitter).
My Problem now is that the button 3 is for an Morning Programm which turns the light(first one) on, and does other stuff.
But when I’m using this program, the button one, for the first lamp, is always “off”, but the light is on.
Is there a command to chang a button from “off” to “on”?
Here my code:
var Blynk = require('blynk-library');
var AUTH = 'MY_TOKEN';
var blynk = new Blynk.Blynk(AUTH);
var v1 = new blynk.VirtualPin(1);
var v2 = new blynk.VirtualPin(2);
var v3 = new blynk.VirtualPin(3);
const childProcess = require('child_process');
v1.on('write', function(param) {
if (param == 1) {
childProcess.spawn('~/Desktop/Programme/Remote/steuerungA 1', { shell: true });
}
if (param == 0) {
childProcess.spawn('~/Desktop/Programme/Remote/steuerungA 0', { shell: true });
}
});
v2.on('write', function(param) {
if (param == 1) {
childProcess.spawn('~/Desktop/Programme/Remote/steuerungB 1', { shell: true });
}
if (param == 0) {
childProcess.spawn('~/Desktop/Programme/Remote/steuerungB 0', { shell: true });
}
});
v3.on('write', function(param) {
childProcess.spawn('~/Desktop/Programme/Remote/steuerungA 1', { shell: true });
//other stuff
});