led apertura cierre

parent 845bd96d
Showing with 7 additions and 0 deletions
......@@ -21,10 +21,15 @@ var motor = new Gpio(13, { mode: Gpio.OUTPUT });
var pulseWidth = 1850;
motor.servoWrite(pulseWidth);
RED.pwmWrite(255);
GREEN.pwmWrite(0);
BLUE.pwmWrite(0);
// Abrir puerta
function abrirPuerta(){
GREEN.pwmWrite(255);
var increment = -10;
var intervalo = setInterval(function () {
......@@ -43,6 +48,8 @@ function abrirPuerta(){
// Cerrar puerta
function cerrarPuerta(){
RED.pwmWrite(255);
var increment = 10;
var intervalo = setInterval(function () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment