#include // Define the Servo object Servo myServo; // Define the pin used for PWM control #define SERVO_PIN D5 void setup() { myServo.setPeriodHertz(50); // Standard 50Hz servo myServo.attach(SERVO_PIN, 500, 2400); // Attach pin, min and max pulse widths in microseconds } void loop() { myServo.write(0); delay(1000); myServo.write(90); delay(1000); myServo.write(180); delay(1000); }