Open markv1 opened 9 years ago
Hi! Did you find any solution to this problem? Because i'm having the same trouble. I'm using a setTimeout function but the pin is activated just for a second or less.
Thanks!
Are you referring to the fact that the pin value is set to 0 on open? I added a line to the end of the setDirection method as shown here:
fs.writeFile(sysFsPath + "/gpio" + pinMapping[pinNumber] + "/value", 1, (callback || noop));
This sets the default export value to 1. This should be added to the library IMO but I'm not sure how to request that.
when running the following code repeatedly (setting the GPIO pin to 1 -relay off multiple times), occationally i hear the relay click and get a momentary contact on. I also see a GPIO-Admin: could not flush data to /sys/class/gpio/export: device or resource busy. I am using a RPb+ and sainsmart 8ch relay board. The momentary contact on when the relay is already off is the most problematic.
gpio.open(pin,'output', function(err) { gpio.write(pin,highLow,function() { gpio.close(pin);
}); });