Hello, all.
I'm very happy to have found a servo library that has variable speed. Thank you for posting it, Korman. A funny thing is happening though. The code that would work with Servo.h, where I call functions in sequence, isn't working here. The slow speed is fantastic, but I'm having difficulty sweeping the servos between positions on a loop like I was with the original library. It stops at the first position in the loop, without going further. Any suggestions?#include <VarSpeedServo.h>
VarSpeedServo RR;
VarSpeedServo RL;
VarSpeedServo MR;
VarSpeedServo ML;
VarSpeedServo FR;
VarSpeedServo FL;
//int pos =90;
int fanPin = 1;
void setup(){
pinMode(fanPin, OUTPUT);
digitalWrite(fanPin, HIGH);
RR.attach(5);
RL.attach(9);
MR.attach(4);
ML.attach(10);
FR.attach(3);
FL.attach(11);
RR.slowmove(90,255);
RL.slowmove(90,255);
MR.slowmove(90,255);
ML.slowmove(90,255);
RR.slowmove(90,255);
RL.slowmove(90,255);
}
void loop(){
RR.slowmove(90,255);
RL.slowmove(90,255);
MR.slowmove(90,255);
ML.slowmove(90,255);
RR.slowmove(90,255);
RL.slowmove(90,255);
delay(150);
yawRight();
delay(150);
// yawLeft();
}
void yawRight(){
FR.slowmove (65, 15);
FL.slowmove (65, 15);
MR.slowmove (65, 15);
ML.slowmove (65, 15);
RR.slowmove (65, 15);
RL.slowmove (65, 15);
}
void yawLeft(){
FR.slowmove (115, 15);
FL.slowmove (115, 15);
MR.slowmove (115, 15);
ML.slowmove (115, 15);
RR.slowmove (115, 15);
RL.slowmove (115, 15);
}