Created
September 15, 2014 15:15
-
-
Save drnugent/f837b51a975d1fc91a78 to your computer and use it in GitHub Desktop.
PubNub-Tessel Blinking LED Integration
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 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