#include <Servo.h>
Servo srv;
void setup() {
srv.attach(9); // Attach to the servo on pin 9
}
To use a servo, you need to call attach() function first. It starts generating a PWM signal controlling a servo on a specified pin. On boards other than Arduino Mega, use of Servo lib...