I'd like to use an arduino to control 2 servos. I have found a single servo motor code but i coudnt find it multiple servo code.
i tryin to make a 4 different angle (0, 90, 180, 360 dgrees) with one of servo motor and other servo is 8 different angles (0, 45, 90, 135, 180, 225, 270, 360 dgrees).
Servo myservo; // create servo object to control a servo
void setup()
{
myservo.attach(9); // attaches the servo on pin 9 to the servo object
}
void loop()
{
myservo.write(10); // sets the servo position according to the scaled value
delay(1000); // waits for the servo to get there
myservo.write(90); // sets the servo position according to the scaled value
delay(1000); // waits for the servo to get there
myservo.write(180); // sets the servo position according to the scaled value
delay(1000); // waits for the servo to get there
myservo.write(360); // sets the servo position according to the scaled value
delay(1000); // waits for the servo to get there
}
hi God members, i am doing same project with him. And we want 1 servo to spin at random angles (0,45, 90,135,180) for 1-4s, and another servo to spin at (0,45,90,135,180)