Skip to content

Instantly share code, notes, and snippets.

@bjallen
Created February 7, 2014 20:52
Show Gist options
  • Save bjallen/8871616 to your computer and use it in GitHub Desktop.
Save bjallen/8871616 to your computer and use it in GitHub Desktop.
node script for controlling leds on my raspberry pi
var gpio = require('gpio');
var green = gpio.export(4, {
direction: 'out',
interval: 200,
ready: function() {
console.log('green is ready');
}
});
var yellow = gpio.export(17, {
direction: 'out',
interval: 200,
ready: function() {
console.log('yellow is ready');
}
});
var red = gpio.export(22, {
direction: 'out',
interval: 200,
ready: function() {
console.log('red is ready');
}
});
module.exports.green = green;
module.exports.yellow = yellow;
module.exports.red = red;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment