#include <Servo.h> // Add a library for controlling a servo
Servo servo; // Give a name to the variable
void setup() {
Serial.begin(115200); // Start the serial monitor to read data
servo.attach(11); // Servo attached to Arduino UNO
}
void loop() {
servo.write(0);
Serial.print("Angle = ");
Serial.println(0);
delay(3000); // time in milliseconds (3 secs)
servo.write(90);
Serial.print("Angle = ");
Serial.println(90);
delay(3000);
servo.write(180);
Serial.print("Angle = ");
Serial.println(180);
delay(3000);
} // Closing loop and code