/* Servo Motor Control using the Arduino Servo Library by Dejan, https://howtomechatronics.com */ #include Servo myservo; // create servo object to control a servo Servo myservo2; // create servo2 object to control a second servo int LED = D8; void setup() { myservo.attach(D0,600,2300); // (pin3, min, max) myservo2.attach(D4,600,2300); // (pin4, min, max) pinMode(LED, OUTPUT); } void loop() { myservo.write(0); // tell servos to go to a particular angle myservo2.write(0); delay(1000); myservo.write(90); myservo2.write(90); delay(1000); myservo.write(135); myservo2.write(135); delay(1000); myservo.write(180); myservo2.write(180); delay(1000); digitalWrite(LED, HIGH); // turn the LED on (HIGH is the voltage level) delay(100); // wait for a second digitalWrite(LED, LOW); // turn the LED off by making the voltage LOW delay(100); // wait for a second }