JamesBarwell / rpi-gpio.js

Control Raspberry Pi GPIO pins with node.js
MIT License
657 stars 116 forks source link

destroy does not unexport #118

Open Machine-3R opened 2 years ago

Machine-3R commented 2 years ago

After running my script /sys/class/gpio/gpio4/ still exists.

var gpio = require('rpi-gpio');

gpio.setup(7, gpio.DIR_OUT, function (err) { if (err) throw err; });

let value = false; let t = setInterval(function () { value = !value; gpio.write(7, value, function (err) { if (err) throw err; console.log('GPIO4 (pin 7):', value); }); }, 1000);

setTimeout(function () { clearInterval(t); gpio.destroy((err) => { console.log(err); }); process.kill(process.pid, 'SIGTERM'); }, 10000);

using nodejs v10.5.0 on RPi.

Am i doing something wrong?