Created
September 15, 2014 03:41
-
-
Save Resseguie/e308663338f38ed7770c to your computer and use it in GitHub Desktop.
RGB LED on then color
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | |
led.color("#ffffff"); | |
}); | |
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