Created
June 6, 2014 17:26
-
-
Save rwaldron/172835bc5afe4b5f997f 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 Cylon = require('cylon'); | |
// Initialize the robot | |
Cylon.robot({ | |
connection: { name: 'voodoospark', adaptor: 'voodoospark', accessToken: 'XYZPDQ123', deviceId: '123ABC456', module: 'spark' }, | |
device: {name: 'led', driver: 'led', pin: 'D0'}, | |
work: function(my) { | |
every((1).second(), function() {my.led.toggle()}); | |
} | |
}).start(); |
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"); | |
var Spark = require("spark-io"); | |
var board = new five.Board({ | |
io: new Spark({ | |
token: "your token", | |
deviceId: "your device id" | |
}) | |
}); | |
board.on("ready", function() { | |
var led = new five.Led("D7"); | |
led.blink(1000); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment