#include <Servo.h>
#define LED_PIN 13 // Pin connected to the LED (built-in LED on most Arduino boards)
#define SERVO_PIN 9 // Pin connected to the servo motor
Servo servo; // Create a servo object to control the servo motor
void setup() {
pinMode(LED_PIN, OUTPUT); // Set the LED pin as an output
servo.attach(SERVO_PIN); // Attach the servo to the specified pin
}
void loop() {
// Turn the LED on (HIGH) for 500 milliseconds
digitalWrite(LED_PIN, HIGH);
delay(500);
// Turn the LED off (LOW) for 500 milliseconds
digitalWrite(LED_PIN, LOW);
delay(1000);
// Move the servo motor to 0 degrees
servo.write(0);
delay(1000);
// Move the servo motor to 90 degrees
servo.write(90);
delay(1000);
// Move the servo motor to 180 degrees
servo.write(30);
delay(1000);
}