puerta abriendo y cerrando

parent 978af40f
Showing with 7 additions and 8 deletions
...@@ -12,25 +12,24 @@ var RED = new Gpio(4, {mode: Gpio.OUTPUT}); ...@@ -12,25 +12,24 @@ var RED = new Gpio(4, {mode: Gpio.OUTPUT});
var GREEN = new Gpio(17, {mode: Gpio.OUTPUT}); var GREEN = new Gpio(17, {mode: Gpio.OUTPUT});
var BLUE = new Gpio(27, {mode: Gpio.OUTPUT}); var BLUE = new Gpio(27, {mode: Gpio.OUTPUT});
//apertura maxima 550
//cierre maximo 1850 //cierre maximo 1850
//apertura maxima 550
var motor = new Gpio(13, {mode: Gpio.OUTPUT}), var motor = new Gpio(13, {mode: Gpio.OUTPUT}),
pulseWidth = 1850, pulseWidth = 1850,
increment = 100; increment = -100;
/*var test = setInterval(function () { var test = setInterval(function () {
motor.servoWrite(pulseWidth); motor.servoWrite(pulseWidth);
pulseWidth += increment; pulseWidth += increment;
if (pulseWidth >= 2000) {
if (pulseWidth >= 1850) {
increment = -100; increment = -100;
} else if (pulseWidth <= 1000) { } else if (pulseWidth <= 550) {
increment = 100; increment = 100;
} }
}, 1000);*/
motor.servoWrite(pulseWidth);
}, 1000);
// Clean LEDs // Clean LEDs
//RED.pwmWrite(dutyCycle); //RED.pwmWrite(dutyCycle);
......
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