Created
July 15, 2016 04:12
-
-
Save prestonp/e4553ccc3fc5fee0a517ad250f04f0bf to your computer and use it in GitHub Desktop.
dash button -> gotem
This file contains hidden or 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 get = require('simple-get'); | |
var snuggle = 'a0:02:dc:23:50:30'; | |
var dash_button = require('node-dash-button'); | |
var dash = dash_button(snuggle); | |
var hornURL = 'http://got-em.mybluemix.net/sounds/horn?room=stacktheplanet'; | |
dash.on("detected", function (){ | |
get(hornURL, (err, res) => { | |
if (err) return console.log(err); | |
console.log(new Date().toLocaleString() + ' - triggered horn'); | |
}); | |
}); | |
console.log('listening for buttons'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment