Skip to content

Instantly share code, notes, and snippets.

@Resseguie
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Resseguie/b8297d36dd41b320f29f to your computer and use it in GitHub Desktop.
Save Resseguie/b8297d36dd41b320f29f to your computer and use it in GitHub Desktop.
Spark RGB LED
var five = require("johnny-five"),
Spark = require("spark-io"),
board = new five.Board({
io: new Spark({
token: process.env.SPARK_TOKEN,
deviceId: process.env.SPARK_DEVICE_ID
})
});
// The board's pins will not be accessible until
// the board has reported that it is ready
board.on("ready", function() {
console.log("CONNECTED");
var led = new five.Led.RGB({
pins: {
red: "A5",
green: "A6",
blue: "A7"
}
});
led.on();
});
board.on("error", function(error) {
console.log(error);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment