You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I was trying to test the examples and seems like I'm stuck with this error: GPIO Setup ERROR: { Error: EINVAL: invalid argument, write errno: -22, code: 'EINVAL', syscall: 'write' }
Here's my code:
`// GPIO
var gpio = require('rpi-gpio');
var pin = 4;
var delay = 2000;
var countIO = 0;
var max = 3;
gpio.setup(pin, 'out', on);
function on (err) {
if (err) {
logger.info('GPIO Setup ERROR: %O', err);
return;
}
if (countIO >= max) {
gpio.destroy(function() {
logger.info('Closed pins, now exit');
});
return;
}
setTimeout(function() {
gpio.write(pin, 1, off);
countIO += 1;
}, delay);
}
function off() {
setTimeout(function() {
gpio.write(pin, 0, on);
}, delay);
}`
I'm using node v8.9.0 on a Raspberry Pi Zero
User is added to gpio group.
Any idea about what's wrong?
Thanks!
LE: I just saw that actually pin 4 ( one I'm trying to use ) is mapped to 7. So I change it in my code to 7. No I have another error: GPIO Setup ERROR: %O { Error: EBUSY: resource busy or locked, write errno: -16, code: 'EBUSY', syscall: 'write' }
The text was updated successfully, but these errors were encountered:
Hi,
I was trying to test the examples and seems like I'm stuck with this error:
GPIO Setup ERROR: { Error: EINVAL: invalid argument, write errno: -22, code: 'EINVAL', syscall: 'write' }
Here's my code:
`// GPIO
var gpio = require('rpi-gpio');
I'm using node v8.9.0 on a Raspberry Pi Zero
User is added to gpio group.
Any idea about what's wrong?
Thanks!
LE: I just saw that actually pin 4 ( one I'm trying to use ) is mapped to 7. So I change it in my code to 7. No I have another error:
GPIO Setup ERROR: %O { Error: EBUSY: resource busy or locked, write errno: -16, code: 'EBUSY', syscall: 'write' }
The text was updated successfully, but these errors were encountered: