#include <Arduino.h> // Include standard Arduino library
#include <Servo.h> // Include Servo library for controlling servo motors
static const int SERVO_PIN = 9; // Define pin 9 for the servo signal
Servo myServo; // Create a Servo object to control the servo motor
void setup(void) {
myServo.attach(SERVO_PIN); // Attach the servo to the defined pin
}
void loop(void) {
myServo.write(0); // Move servo to 0° position
delay(1000); // Wait for 1 second
myServo.write(90); // Move servo to 90° position (middle)
delay(1000); // Wait for 1 second
myServo.write(180); // Move servo to 180° position
delay(1000); // Wait for 1 second
myServo.write(90); // Move servo back to 90° position
delay(1000); // Wait for 1 second
}