Skip to content

Instantly share code, notes, and snippets.

@drnugent
Created September 15, 2014 15:15
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 drnugent/f837b51a975d1fc91a78 to your computer and use it in GitHub Desktop.
Save drnugent/f837b51a975d1fc91a78 to your computer and use it in GitHub Desktop.
PubNub-Tessel Blinking LED Integration
var pubnub = require("pubnub").init({
publish_key: "demo",
subscribe_key: "demo",
uuid: "your_name_here" + Math.floor(Math.random()*1000)
});
var tessel = require("tessel");
var led1 = tessel.led[0].output();
var led2 = tessel.led[1].output();
var led3 = tessel.led[2].output();
pubnub.subscribe({ channel: "tessel-light", message: function(m) {
led1.toggle(); led2.toggle(); led3.toggle();
}});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment