Pi_Node_Example/stream_led.js
2014-12-21 20:04:22 -05:00

13 lines
274 B
JavaScript

/**
* stream button presses to a LED
*
* circuit:
* https://learn.adafruit.com/assets/21908
*
*/
var GpioStream = require('gpio-stream'),
button = GpioStream.readable(17),
led = GpioStream.writable(18);
// pipe the button presses to the LED
button.pipe(led);