servo test

parent 50f58e23
Showing with 5 additions and 5 deletions
...@@ -19,7 +19,7 @@ var BLUE = new Gpio(27, {mode: Gpio.OUTPUT}); ...@@ -19,7 +19,7 @@ var BLUE = new Gpio(27, {mode: Gpio.OUTPUT});
var motor = new Gpio(13, {mode: Gpio.OUTPUT}); var motor = new Gpio(13, {mode: Gpio.OUTPUT});
var pulseWidth = 1850; var pulseWidth = 1850;
var increment = -99; var increment = -10;
var test = setInterval(function () { var test = setInterval(function () {
motor.servoWrite(pulseWidth); motor.servoWrite(pulseWidth);
...@@ -27,12 +27,12 @@ var test = setInterval(function () { ...@@ -27,12 +27,12 @@ var test = setInterval(function () {
pulseWidth += increment; pulseWidth += increment;
if (pulseWidth >= 1850) { if (pulseWidth >= 1850) {
increment = -99; increment = -10;
} else if (pulseWidth <= 563) { } else if (pulseWidth <= 950) {
increment = 99; increment = 10;
} }
}, 1000); }, 100);
// 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