UNPKG

rpio2

Version:

Control Raspberry Pi GPIO pins with node.js. Fast and easy to use.

17 lines (11 loc) 268 B
const Gpio = require('../lib/index.js').Gpio; var gs = Gpio.createWriteStream(40, { mode: Gpio.OUTPUT, state: Gpio.HIGH }); console.log('Please input value of P40.'); process.stdin.pipe(gs); process.on("SIGINT", function(){ gs.end(); process.exit(0); });