void loop() { myservo.attach(9); // Attach servomotor on 9th pin myservo.write(60); // servomotor is moving myservo.detach(); // detach servomotor }