Skip to content

Instantly share code, notes, and snippets.

@cristiandley
Created June 15, 2017 15:57
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 cristiandley/d78066ea86fe9062062aa20a0be1d145 to your computer and use it in GitHub Desktop.
Save cristiandley/d78066ea86fe9062062aa20a0be1d145 to your computer and use it in GitHub Desktop.
[RASPBERRY] Gira el motor depues de encender tocar un boton
var gpio = require("pi-gpio");
function despuesDelEncendido() {
/**
* Habilita la salida 11 (GPIO 11)
*/
gpio.open(11, "output", function(err) {
gpio.write(11, 1, function() {
gpio.close(11);
});
});
}
function tocaBoton() {
/**
* Lee el estado de el puerto 11 setea el valor contrario
*/
gpio.read(11, function(err, value) {
if(err) throw err;
const turn = !value;
setTimeout(function () {
}, 60000);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment