I am attempting to access gpio pin on my Raspberry pi using Node.js + the pi-gpio module but I get the following error:
"Error when trying to open pin 11" "gpio-admin: could not flush data to /sys/class/gpio/ex[prt: device or resource busy"
I've checked that directory, with pin 11 exported or unexported I still get the same error.
In-case it's the code I've attempted to convert from Python to node, here is the code for review:
var gpio = require("pi-gpio");
function motor1(){
gpio.write(7, 1, function(err){
//if err
console.log("sent 1");
});
}
function motor2(){
gpio.write(11, 1, function(err){
console.log("sent...");
});
}
gpio.open(7);
gpio.open(11);
motor1();
motor2();