I have 3 functions defined.. the first calls the second and second calls the third. The 1st and 2nd will always run but the 3rd will only run if the 2nd value is false. If the 2nd value is true it should stop and return, however, the third function is still running in full.
It works perfect if gpio 38 is false so I know my script is good in design.
below is example of the code I am using for the 2nd function and I am using node and JavaScript.
Thanks for any help.
function second(err, value){
if (value === true){ //this is the value of gpio second pin 38
console.log('Your script stopped due to a true reading');
return;
}else{
gpio.write(35, true, third);
}
}