Skip to content

Instantly share code, notes, and snippets.

@Resseguie
Created June 5, 2014 23:20
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/56f0c3765ceaf1721f27 to your computer and use it in GitHub Desktop.
Save Resseguie/56f0c3765ceaf1721f27 to your computer and use it in GitHub Desktop.
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