#include <Servo.h>
Servo myservo; // Create servo object to control a servo
int Digital_PWM_Pin_Servo_Connected_2 = 10; // A Digital Pin, which Supports PWM output signal
// This must use the default resolution of 8 bits (0-255)
// and frequency of 500 Hz.
int Initial_Servo_Angle = 0; // Minimum Shaft Rotation. Angle in Degree
int Delay_Time_2 = 500; // Delay time for servo motor rotation after each increment
int Hold_Time_2 = 1000; // Time duration to hold an object using a servo-gripper
// Here, 1000 is equal to 1 second.
int Rotate_Servo_by_2 = 20; // Angle in Degree. This is the instruction to the servo motor
// Set the Servo Angle you want to Rotate
void setup()
{
// Method 1 Setup
pinMode(Digital_PWM_Pin_Servo_Connected_1, OUTPUT); // Initialize digital pin 9 as an output pin.
Equivalent_PWM_Value = map(Rotate_Servo_by_1, Min_Servo_Angle, Max_Servo_Angle, Min_PWM_Value, Max_PWM_Value);
// Method 2 Setup
myservo.attach(Digital_PWM_Pin_Servo_Connected_2); // Attach the servo on pin 10 to the servo object
}
void loop()
{