servo test

parent dff04778
Showing with 7 additions and 4 deletions
......@@ -21,12 +21,10 @@ var motor = new Gpio(13, {mode: Gpio.OUTPUT});
var pulseWidth = 1850;
var increment = -10;
motor.servoWrite(pulseWidth);
for(var i=0;i<90;i++){
setTimeout(function(){
motor.servoWrite(pulseWidth);
pulseWidth += -10;
}, 100);
setTimeout(openFunct, 100);
if(pulseWidth > 950){
console.log("Fuera de rango en apertura");
......@@ -34,6 +32,11 @@ for(var i=0;i<90;i++){
}
}
function openFunct(){
motor.servoWrite(pulseWidth);
pulseWidth += -10;
}
/*var test = setInterval(function () {
motor.servoWrite(pulseWidth);
......
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