It looks like you intended to write either:
#include <Servo.h>
const byte ServoPin = 10;
Servo servo;
void setup()
{
// put your setup code here, to run once:
servo.attach(ServoPin);
}
void loop()
{
// put your main code here, to run repeatedly:
servo.writeMicroseconds(1500);
}
or
const byte ServoPin = 10;
void setup()
{
// put your setup code here, to run once:
pinMode(ServoPin, OUTPUT);
}
void loop()
{
// put your main code here, to run repeatedly:
digitalWrite(ServoPin, HIGH)
delayMicroseconds(1500);
digitalWrite(ServoPin, LOW);
delay(20); // Keep the repeat rate near 50 Hz
}
Either will move the servo to a middle position and keep it there forever. Once you assign a pin to the Servo library you should not write to it directly.