Created
August 23, 2019 20:51
-
-
Save ricardoogliari/3be2a1f9e86499ef23036ce73c53111f 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 five = require("johnny-five"); | |
var board = new five.Board(); | |
const client = require('twilio')( | |
"AC6491..........", | |
"d975f..........."); | |
board.on("ready", function() { | |
var button = new five.Button(8); | |
button.on("press", function() { | |
client.messages.create({ | |
body: 'Porta Aberta!', | |
to: "+5511993643538", | |
from: "+12182827243" | |
}); | |
}); | |
button.on("release", function() { | |
client.messages.create({ | |
body: 'Porta Fechada!', | |
to: "+5511993643538", | |
from: "+12182827243" | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment