Skip to content

Instantly share code, notes, and snippets.

@julianshen
Created December 9, 2013 01:05
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 julianshen/7865942 to your computer and use it in GitHub Desktop.
Save julianshen/7865942 to your computer and use it in GitHub Desktop.
var SparkCore = require('./spark_core');
var util = require('util');
var juliansCore = new SparkCore({
device_id: 'YOUR_DEVICE_ID',
access_token: 'YOUR_ACCESS_TOKEN'
});
var val = 0;
(function blink() {
val = (val + 1) % 2;
juliansCore.digitalWrite('D7', val, function(data) {
console.log(util.inspect(data));
setTimeout(blink, 1000);
}, function(error) {
console.log('error');
console.log(error);
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment