This commit is contained in:
2018-05-16 10:10:23 +02:00
commit 79abc63edd
597 changed files with 93351 additions and 0 deletions

19
node_modules/onoff/examples/debounce-button.js generated vendored Normal file
View File

@ -0,0 +1,19 @@
"use strict";
const Gpio = require('../onoff').Gpio;
const led = new Gpio(17, 'out');
const button = new Gpio(4, 'in', 'rising', {debounceTimeout: 10});
button.watch(function (err, value) {
if (err) {
throw err;
}
led.writeSync(led.readSync() ^ 1);
});
process.on('SIGINT', function () {
led.unexport();
button.unexport();
});