UNPKG

onoff

Version:

GPIO access and interrupt detection with Node.js

17 lines (10 loc) 285 B
'use strict'; const Gpio = require('../onoff').Gpio; const led = new Gpio(17, 'out'); const iv = setInterval(_ => led.writeSync(led.readSync() ^ 1), 100); setTimeout(_ => { clearInterval(iv); led.writeSync(0); led.unexport(); console.log('ok - ' + __filename); }, 2000);