I am using the 'VarSpeedServo' library, which is fantastic and I believe was contributed by 'Korman'.
My question; is there a way to soft start the servos, i,e, get them to move to their start position from power up without jumping at full speed?
Can it be done through the Arduino or can it be done with electronics?
#include <VarSpeedServo.h>
const int mainPin1 = 3;
const int mainPin2 = 5;
const int mainPin3 = 10;
const int mainPin4 = 11;
const int ServoMin = 850; // Minimum pulse width for servos in ms.
const int ServoMax = 2100; // Maximum pulse width for servos in ms.int buttonPin = 13;
int buttonState = 1;VarSpeedServo ServoHighHandRotate;
VarSpeedServo ServoHighHandTip;
VarSpeedServo ServoLowHandRotate;
VarSpeedServo ServoLowHandTip;//*****************************************************************
void setup() {
pinMode(buttonPin, INPUT);
ServoHighHandRotate.attach (mainPin1, ServoMin, ServoMax);
ServoHighHandTip.attach (mainPin2, ServoMin, ServoMax);
ServoLowHandRotate.attach (mainPin3, ServoMin, ServoMax);
ServoLowHandTip.attach (mainPin4, ServoMin, ServoMax);
}//*****************************************************************
//Left Hand (High Hand) rotate clockwise (180)
//Left Hand (High Hand) rotate anti-clockwise (0)
//Left Hand (High Hand) tip forwards (180)
//Left Hand (High Hand) tip backwards (0)//Right Hand (High Hand) rotate clockwise (180)
//Right Hand (High Hand) rotate anti-clockwise (0)
//Right Hand (High Hand) tip forwards (0)
//Right Hand (High Hand) tip backwards (180)//*****************************************************************
void loop() {
//buttonState = digitalRead(buttonPin);
//if (buttonState == HIGH)
{
ServoHighHandRotate.slowmove (90, 20); //All Hands move to centre
ServoHighHandTip.slowmove (90, 20); //All Hands move to centre
ServoLowHandRotate.slowmove (90, 20); //All Hands move to centre
ServoLowHandTip.slowmove (90, 20); //All Hands move to centre
delay(4000);{
ServoHighHandRotate.slowmove (180, 20); //Left hand Rotate clockwise
ServoLowHandRotate.slowmove (180, 20); //Right hand Rotate clockwise
delay(3000);{
ServoHighHandTip.slowmove (0, 20); //Left hand Tip backward
ServoLowHandTip.slowmove (180, 20); //Right hand Tip backward
delay(1500);{
ServoHighHandTip.slowmove (180, 20); //Left hand Tip forward
ServoLowHandTip.slowmove (0, 20); //Right hand Tip forward
delay(2500);{
ServoHighHandTip.slowmove (90, 20); //Left hand backward to centre
ServoLowHandTip.slowmove (90, 20); //Right hand backward to centre
delay(1500);{
ServoHighHandRotate.slowmove (0, 20); //Left hand Rotate anti-clockwise
ServoLowHandRotate.slowmove (0, 20); //Right hand Rotate anti-clockwise
delay(5000);{
ServoHighHandRotate.slowmove (90, 20); //Left hand Rotate clockwise to centre
ServoLowHandRotate.slowmove (90, 20); //Right hand Rotate clockwise to centre
delay(3000);{
ServoHighHandTip.slowmove (0, 20); //Left hand Tip backward
ServoLowHandTip.slowmove (180, 20); //Right hand Tip backward
delay(1500);{
ServoHighHandTip.slowmove (180, 20); //Left hand Tip forward
ServoLowHandTip.slowmove (0, 20); //Right hand Tip forward
delay(2500);{
ServoHighHandTip.slowmove (90, 20); //Left hand Tip backward to centre
ServoLowHandTip.slowmove (90, 20); //Right hand Tip backward to centre
delay(1500);//--------Start of Combined Movements--------------------
{
ServoHighHandRotate.slowmove (180, 20); //Left hand Rotates clockwise
ServoLowHandRotate.slowmove (0, 20); //Right hand Rotates anti-clockwise
delay(3000);{
ServoHighHandRotate.slowmove (0, 20); //Left hand Rotates anti-clockwise
ServoLowHandRotate.slowmove (180, 20); //Right hand Rotates clockwise
delay(1500);{
ServoHighHandTip.slowmove (0, 20); //Left hand Tip backward
ServoLowHandTip.slowmove (180, 20); //Right hand Tip backward
delay(1500);{
ServoHighHandTip.slowmove (180, 20); //Left hand Tip forward
ServoLowHandTip.slowmove (0, 20); //Right hand Tip forward
delay(2500);{
ServoHighHandTip.slowmove (90, 20); //Left hand Tip backward to centre
ServoLowHandTip.slowmove (90, 20); //Right hand Tip backward to centre
delay(1500);{
ServoHighHandRotate.slowmove (180, 20); //Left Hand Rotate clockwise
ServoLowHandRotate.slowmove (0, 20); //Right Hand Rotate anti-clockwise
delay(1000);{
ServoHighHandTip.slowmove (0, 20); //Left hand Tip backward
ServoLowHandTip.slowmove (180, 20); //Right hand Tip backward
delay(1500);{
ServoHighHandTip.slowmove (180, 20); //Left hand Tip forward
ServoLowHandTip.slowmove (0, 20); //Right hand Tip forward
delay(2500);{
ServoHighHandTip.slowmove (90, 20); //Left hand Tip backward to centree
ServoLowHandTip.slowmove (90, 20); //Right hand Tip backward to centre
delay(1500);
{
ServoHighHandRotate.slowmove (90, 20); //Left Hand Rotate anti-clockwise to centre
ServoLowHandRotate.slowmove (90, 20); //Right Hand Rotate clockwise to centre
delay(1000);}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}