Created
June 5, 2014 23:20
-
-
Save Resseguie/56f0c3765ceaf1721f27 to your computer and use it in GitHub Desktop.
This file contains 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('../lib/spark'), | |
board; | |
// Create Johnny-Five board connected via Spark | |
board = new five.Board({ | |
io: new Spark({ | |
token: process.env.SPARK_TOKEN, | |
deviceId: process.env.SPARK_DEVICE_ID | |
}) | |
}); | |
board.on('ready', function() { | |
// Initialize the RGB LED | |
var led = new five.Led.RGB({ | |
pins: { | |
red: 'A5', | |
green: 'A6', | |
blue: 'A7' | |
} | |
}); | |
led.color('#FF0000'); | |
this.wait(3000,function(){ | |
led.on(); // makes it white ("#FFFFFF") | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment